Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- report ztrigger_ordrsp.
- tables: nast,
- tnapr,
- toa_dara,
- zorderqueue.
- data: gv_returncode type sysubrc,
- gv_end(1).
- form entry using cv_returncode type sysubrc
- uv_screen type char1.
- data: "lt_vbdpr TYPE tbl_vbdpr,
- ls_comwa type vbco3,
- lv_task(10) type c,
- lv_message_type type kschl,
- lv_message_partner type nast-parnr,
- rcv_jobs type i,
- snd_jobs type i.
- ls_comwa-mandt = sy-mandt.
- ls_comwa-spras = nast-spras.
- ls_comwa-kunde = nast-parnr.
- ls_comwa-parvw = nast-parvw.
- if nast-objky+10(6) ne space.
- ls_comwa-vbeln = nast-objky+16(10).
- else.
- ls_comwa-vbeln = nast-objky. "#EC CI_CONV_OK
- endif.
- *--------#981361------insert data on ZORDERQUEUE ----------
- data: ls_queue type zorderqueue,
- ls_aubel type vbrp,
- lt_vbup type table of vbup,
- lt_vbrp type table of vbrp,
- ls_vbrp type vbrp,
- lt_queue type table of zorderqueue.
- select * from vbrp into table lt_vbrp where vbeln = ls_comwa-vbeln.
- cv_returncode = 0.
- if sy-subrc = 0.
- * READ TABLE lt_vbrp INTO ls_vbrp INDEX 1.
- loop at lt_vbrp into ls_vbrp.
- * IF sy-subrc = 0.
- ls_queue-vbeln = ls_vbrp-vbeln.
- ls_queue-aubel = ls_vbrp-aubel.
- ls_queue-dater = sy-datum.
- ls_queue-timer = sy-uzeit.
- append ls_queue to lt_queue.
- endloop.
- * SELECT COUNT(*) FROM zorderqueue WHERE vbeln = ls_comwa-vbeln.
- *
- * IF sy-dbcnt IS INITIAL.
- loop at lt_queue into data(ls_queue2).
- select single * from zorderqueue into @data(ls_conf) where vbeln = @ls_comwa-vbeln and aubel = @ls_queue2-aubel.
- if sy-subrc <> 0.
- insert zorderqueue from ls_queue2.
- * append ls_queue2 to lt_queue2.
- clear ls_queue2.
- endif.
- endloop.
- * INSERT zorderqueue FROM TABLE lt_queue2.
- cv_returncode = sy-subrc.
- endif.
- endform.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement