‎2007 Jun 25 11:52 AM
I am uploading the data for Matarial specifications in the transaction in qs61 by BDC.
There are multiple records for 1 material.
I am stuck at the selecting 2 nd record through BDC.
I have attached the sample code.
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RQMSP-MKMNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RQMSP-WERKS(01)'
itab-WERKS.
perform bdc_field using 'RQMSP-MKMNR(01)'
It selects the first row and posts the record.
But for 2nd or more than 2 records evenif i create 1 counter.It is unable to post the record.
counter = 01.
counter = counter + 1.
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RQMSP-MKMNR(counter)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RQMSP-WERKS(counter)'
wa_itab-WERKS.
perform bdc_field using 'RQMSP-MKMNR(counter)'
wa_itab-MKMNR.
evenif counter has value 02 it selects the 2nd row but the fiels ae blank.
‎2007 Jun 25 12:17 PM
Here is the answer:
Do it like this
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQMS1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Loop at itab.
counter = 00.
counter = counter + 1.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RQMSP-WERKS(counter)'
wa_itab-WERKS.
perform bdc_field using 'RQMSP-MKMNR(counter)'
wa_itab-MKMNR.
endloop.
This will help if many entries are done on the same screen using table control.
Regards
Vijai
*Reward Pnts if useful