Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

urgent:

Former Member
0 Kudos

hi all sap gurus,

Post Goods issue tcode ZVL02N this is manual and

goods receipt tcode MIGO this is automatic,

create invoice tcode VF01 this is automatic,

Logistics Invoice Verification MIRO this is automatic,

clearing tcode FB05 this also automatic.

here the requirement is we need to create tcode ZVL02N, based on purchase order [rice and sales order price, the postgoods issue need to trigger and the remaining one by one invoice , invoice receipt and cleaing should be trigger one by one.

how can i proceed to do this,

pls help me in this regard,

thanks in advance,

points will be rewarded,

2 REPLIES 2

Former Member
0 Kudos

you can create your repot as BDC for good issue, invoice, invoice receipt and clearing...

take PO Price and Sales Order Price as input to this report...

based on the input.. fetch corresponding data tha is needed as input for the above all transactions.. and poppulate it in BDC for these TCODEs...

execute these TCODEs one by one as you populate the data...

0 Kudos

yes BDC is good option ihave done such coding for MI01 and Mi04 and so on...inventory counting

RUN BDC for first T COde and then pick the messages and get the document number from messages and put that documentin next T Code and so on..please seee folloning code for getting Ducment no (doc_no from MI01 and used in MI04)

please find example code as follows...

perform bdc_screen using 'SAPMM07I' '0700' 'X'.

*perform bdc_field using 'RM07I-BLDAT' .

*perform bdc_field using 'RM07I-GIDAT' sy-datum.

perform bdc_field using 'IKPF-WERKS' ZGKPF-DC_CODE.

perform bdc_field using 'IKPF-LGORT' t001l-lgort.

perform bdc_field using 'IKPF-SPERR' 'X'.

perform bdc_field using 'RM07I-XLVOCA' 'X'.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0721' 'X'.

i = 1.

loop at itab_stock.

concatenate 'ISEG-MATNR(' i ')' into fnam.

perform bdc_field using fnam itab_stock-matnr.

if i = '12'.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0721' 'X'.

i = 0.

endif.

i = i + 1.

endloop.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0721' 'X'.

perform bdc_field using 'BDC_OKCODE' '=BU'.

call transaction 'MI01' using itab_bdcdata mode 'A' MESSAGES INTO

ITAB_msg.

CLEAR itab_bdcdata[].

loop at itab_msg where msgtyp = 'S'.

break-point.

message i010(zmgs) with itab_msg-MSGV1.

docno = itab_msg-msgv1.

endloop.

commit work.

*perform bdc_mi04.

*select * into corresponding fields of table itab from ikpf.

*

*read table itab index sy-dbcnt.

*docno = itab-iblnr.

*message i010(zmgs) with docno.

perform bdc_mi04.

endform.

form bdc_mi04 .

perform bdc_screen using 'SAPMM07I' '0701' 'X'.

perform bdc_field using 'RM07I-IBLNR' docno.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0731' 'X'.

i = 1.

loop at itab_stock.

quantchar = itab_stock-menge.

concatenate 'ISEG-ERFMG(' i ')' into fnam.

perform bdc_field using 'BDC_CURSOR' FNAM.

perform bdc_field using fnam quantchar.

  • BREAK-POINT.

if i = '5'.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0731' 'X'.

i = 0.

endif.

i = i + 1.

endloop.

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_screen using 'SAPMM07I' '0731' 'X'.

perform bdc_field using 'BDC_OKCODE' '=BU'.

call transaction 'MI04' using itab_bdcdata mode 'A'.

endform. " bdc_mi04