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 for TCode KE21N

Former Member
0 Likes
1,613

Hi Forums!

I have a BDC transaction for this tcode and the program goes through a loop and posts transactions.

I receive messages when the program completes that

Line items added (document "1737 ")

however, all of my documents except for my last document do not exists when I check them in KE23N?

I have tried putting a COMMIT WORK in after each BDC but, no luck.

any help appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,512

Hi ,

Are you using call transaction.

Usually call transaction do not require a commit work as the it will be taken care by the transaction itself.

Try with

commit work and wait.

Regards,

Satish

11 REPLIES 11
Read only

Former Member
0 Likes
1,513

Hi ,

Are you using call transaction.

Usually call transaction do not require a commit work as the it will be taken care by the transaction itself.

Try with

commit work and wait.

Regards,

Satish

Read only

0 Likes
1,512

I am using perform bdc_transaction using 'KE21N'.

and performs for all my calls.

I put in the commit work and wait. but no luck.

any thing else?

Read only

0 Likes
1,512

Are you refreshing bdcdata table.

if not,

for every loop.

Use this REFRESH BDCDATA.

Regards,

Satish

Read only

0 Likes
1,512

OK, i IN A REFRESH BDCDATA. AFTER MY COMMIT WORK AND WAIT but, no luck the document still does not exist?

anything else I can try?

Read only

0 Likes
1,512

Can you copy that piece of code?

Regards,

Satish

Read only

0 Likes
1,512

FORM FILL_DATA .

  DATA LV_CNT TYPE I VALUE 0.

  perform open_group.

  LOOP AT ZSALHIST_ITAB.

    IF lv_cnt < 2.
*      perform open_group.

     perform bdc_dynpro      using 'SAPMKEI2' '0100'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RADIOCURR3'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=NEXT'.
      perform bdc_field       using 'CEST1-VRGAR'
                                    'Z'.
      perform bdc_field       using 'CEST1-BUDAT'
                                    ZSALHIST_ITAB-ZPSTDATE.
      perform bdc_field       using 'CEST1-PERDE'
                                    GV_PERIOD.
      perform bdc_field       using 'RADIOVAL1'
                                    'X'.

      perform bdc_field       using 'GT_LINES_VAL-VALUE(13)'
                                    ZSALHIST_ITAB-ZNATOPERUOM.      "NATIONAL OPERATOR
      perform bdc_field       using 'GT_LINES_VAL-VALUE(14)'
                                    ZSALHIST_ITAB-ZBILLBACKUOM.        "BILL BACK
      perform bdc_field       using 'GT_LINES_VAL-VALUE(16)'
                                    ZSALHIST_ITAB-ZORDQTY.          "ORDER QTY
      perform bdc_field       using 'GT_LINES_VAL-VALUE(17)'
                                    ZSALHIST_ITAB-ZORDWGHT.         "ORDER WEIGHT
      perform bdc_field       using 'GT_LINES_VAL-UNIT(16)'
                                    ZSALHIST_ITAB-ZORDQTYUOM.       "ORDER QTY UOM
      perform bdc_field       using 'GT_LINES_VAL-UNIT(17)'
                                    ZSALHIST_ITAB-ZORDWGHTUOM.      "ORDER WEIGHT UOM
      perform bdc_dynpro      using 'SAPMKEI2' '0200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BUCH'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'CEST1-FADAT'.
      perform bdc_field       using 'CEST1-WADAT'
                                    ZSALHIST_ITAB-ZGOODATE.       "GOODS ISSUE DATE
      perform bdc_field       using 'CEST1-FADAT'
                                    ZSALHIST_ITAB-ZINVDATE.       "INVOICE DATE
    ENDIF.
    lv_cnt = lv_cnt + 1.   " for testing
 ENDLOOP.
  perform close_group.
ENDFORM.                    " FILL_DATA

Edited by: keith warnock on Jul 28, 2009 8:44 PM cut out middle of code for readability

Edited by: keith warnock on Jul 28, 2009 8:49 PM

Read only

0 Likes
1,512

Hi Try this,

at the begining of the loop statement i.e.

FORM FILL_DATA .

DATA LV_CNT TYPE I VALUE 0.

perform open_group.

LOOP AT ZSALHIST_ITAB.

REFERESH BDCDATA. " ADD this

At the end of the loop i.e.

lv_cnt = lv_cnt + 1. " for testing

CLEAR ZSALHIST_ITAB." add this statement

ENDLOOP.

perform close_group.

ENDFORM. " FILL_DATA

No need of commit work.

Regards,

Satish

Read only

0 Likes
1,512

Is that working?

Regards,

Satish

Read only

0 Likes
1,512

Yes, the BDC was working the whole time.

Read only

0 Likes
1,512

I am facing the same problem, please send the code of yoyr BDC program

Regards

Deepak

Read only

Former Member
0 Likes
1,512

Thanks all for your help.

My documents were being posted to different periods and were working... it was my mistake when going to the display screen not changing the periods...

Thanks everyone!