2013 Oct 15 7:08 AM
Hi Experts,
I need to record a transaction and update a table control value in the transaction. But the thing is i have to place a condition so that only that element that matches a value should be updated with given value.
For eg: In the table control there can be many articles like 300001, 300002. I have to update article 300001 quantity with some number say, 1000.
How should i place this condition in the recorded statements
Thanks in advance.
Regards,
Shanthi Priya
2013 Oct 16 5:50 AM
2013 Oct 15 7:17 AM
Hi,
If the articles to be updated are provided in a text file, then 1st get the contents of the text file in an internal table. Then loop the internal table and using IF condition check whether the article is 300001 or not. If the article is 300001 then perform data update else go for next record.
Regards,
Vinod
2013 Oct 15 7:20 AM
2013 Oct 15 7:17 AM
Hi Shanthi,
Show us your BDC recording code to receive a proper answer.
2013 Oct 15 7:32 AM
Hi Paul, as shown in the image articles values and bin values are displayed. In the excel file we'll have article, bin, quantity combination data..
For the time being, i have hard coded the data instead of looping for test purpose. The code is:
do.
read dataset dataset into record.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPML03T' '0111'.
perform bdc_field using 'BDC_CURSOR'
'LTAK-TANUM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LTAK-TANUM'
'100003600'. "Changed TO Number
perform bdc_field using 'LTAK-LGNUM'
'B01'. "Changed Warehouse Number
perform bdc_field using 'RL03T-DUNKL'
record-DUNKL_003.
perform bdc_field using 'RL03T-QENTR'
record-QENTR_004.
perform bdc_dynpro using 'SAPML03T' '0114'.
if record-VLPLA = 'CP011405'. "Changed placed if cond for bin
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'LTAP-NISTA(01)'.
perform bdc_field using 'LTAP-NISTA(01)'
'300'. "Changed quantity changed
perform bdc_dynpro using 'SAPML03T' '0114'.
perform bdc_field using 'BDC_CURSOR'
'LTAK-LGNUM'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_dynpro using 'SAPML03T' '0115'.
perform bdc_field using 'BDC_CURSOR'
'LTAP-ENAME'.
perform bdc_field using 'BDC_OKCODE'
'=DIBE'.
perform bdc_transaction using 'LT12'.
endif. "Changed endif
enddo.
My changes are with comments. Please tell me if we can check this way..
Thanks.
2013 Oct 15 7:45 AM
Hi,
Your program looks correct.
As per screenshot TO's will be confirmed if Source Storage Bin No is CP011405.
Regards,
Vinod
2013 Oct 16 5:50 AM
2013 Oct 16 5:54 AM
2013 Oct 16 6:57 AM