Application Development and Automation 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: 
Read only

BDC Recording

Former Member
0 Likes
1,061

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,019

Thanks all..

Regards,

Shanthi Priya

8 REPLIES 8
Read only

rvinod1982
Contributor
0 Likes
1,019

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

Read only

0 Likes
1,019

Hi,

As per vinod post follow that and apply in your code, it will works max

Thanks,

Syam

Read only

paul_max1
Explorer
0 Likes
1,019

Hi Shanthi,

Show us your BDC recording code to receive a proper answer.

Read only

Former Member
0 Likes
1,019

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.

Read only

0 Likes
1,019

Hi,

Your program looks correct.

As per screenshot TO's will be confirmed  if Source Storage Bin No is CP011405.

Regards,

Vinod

Read only

Former Member
0 Likes
1,020

Thanks all..

Regards,

Shanthi Priya

Read only

0 Likes
1,019

This message was moderated.

Read only

0 Likes
1,019

Hi Priya,

Nice to hear about that.

Can you please close this thread with your solution.

Thanks,

Syam