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 VA02

Former Member
0 Likes
1,977

Hi all,

i am try to update few fields in Va02 .. during recording when i enter the VBELn value .. i get a information screen " Consider subsequent Documents" well this is not recoerded . the problem is when i run this program in ALL Screen Mode it works as i press enter however when i run in No Screen Mode this screen is not handled and so it does not update .

Please help.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,507

First of all, this information message is skipped automatically by the runtime, so you must make sure that you are NOT hitting enter for it in your BDC coding. And really, you should use the BAPI BAPI_SALESORDER_CHANGE instead of a BDC over VA02.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,508

First of all, this information message is skipped automatically by the runtime, so you must make sure that you are NOT hitting enter for it in your BDC coding. And really, you should use the BAPI BAPI_SALESORDER_CHANGE instead of a BDC over VA02.

Regards,

Rich Heilman

Read only

0 Likes
1,507

Hi Rich,

Thanks for ur suggestion however i have to use BDC for VA02. Bapi would have been lot more easy for me . can u help me here . coz every time i do the recording it gives the ionformation and its not handled at runtime

regards

Arnab

Read only

0 Likes
1,507

This is an information message and it is skipped(along with warning messages). You either have coded the ENTER in your BDC which is not needed to skip the message or there is something else which is making your BDC fail. For example, here is a recording of VA02, I'm just enter the VBELN and hitting enter to go to the next screen. This sales document actually showed the "consider subsuquent documents" message and it skips the message just fine.



* Enter VBELN and hit enter
perform bdc_dynpro      using 'SAPMV45A' '0102'.
perform bdc_field       using 'BDC_CURSOR'
                              'VBAK-VBELN'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'VBAK-VBELN'
                              '12345'.

* Now just back out.                              
perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '/EBAC1'.
perform bdc_transaction using 'VA02'.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,507

Hi Arnah,

i think it's better to use BAPI_SALESORDER_CHANGE

Here a short example:

DATA: SALESDOCUMENT LIKE BAPIVBELN-VBELN.

DATA: ORDER_HEADER_INX LIKE BAPISDH1X.

*

DATA: RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE.

DATA: RETURN1 TYPE TABLE OF BAPIRET2 WITH HEADER LINE.

DATA: ORDER_ITEM_IN TYPE TABLE OF BAPISDITM WITH HEADER LINE.

DATA: ORDER_ITEM_INX TYPE TABLE OF BAPISDITMX WITH HEADER LINE.

*

ORDER_HEADER_INX-UPDATEFLAG = 'U'.

*

ORDER_ITEM_IN-ITM_NUMBER = '000010'.

ORDER_ITEM_IN-REASON_REJ = '01'.

APPEND ORDER_ITEM_IN.

*

ORDER_ITEM_INX-ITM_NUMBER = '000010'.

ORDER_ITEM_INX-UPDATEFLAG = 'U'.

ORDER_ITEM_INX-REASON_REJ = 'X'.

APPEND ORDER_ITEM_INX.

*

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = '0000001000'

ORDER_HEADER_INX = ORDER_HEADER_INX

  • SIMULATION = 'X'

TABLES

RETURN = RETURN

ORDER_ITEM_IN = ORDER_ITEM_IN

ORDER_ITEM_INX = ORDER_ITEM_INX.

*

LOOP AT RETURN.

WRITE: / RETURN-TYPE, RETURN-ID, RETURN-NUMBER, RETURN-MESSAGE(50).

ENDLOOP.

*

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = RETURN1.

*

LOOP AT RETURN1.

WRITE: / RETURN1-TYPE, RETURN1-ID, RETURN1-NUMBER, RETURN1-MESSAGE(50).

ENDLOOP.

Regards, Dieter

Read only

Former Member
0 Likes
1,507

Hello,

U can make use of the BAPI_SALESORDER_CHANGE to updatea field in VA02.


Kindly check the following code:


lt_schdl -ITM_NUMBER= '000030'.
lt_schdl -SCHED_LINE = '0001'.
lt_schdl -REQ_QTY = '0000000000001'.
APPEND lt_schdl .
 
lt_schdlx-ITM_NUMBER = '000030'.
lt_schdlx-UPDATEFLAG = 'U'.   " Try 'I' while inserting
lt_schdlx-SCHED_LINE = 'X'.
lt_schdlx-REQ_QTY = 'X'.
APPEND lt_schdlx.
 
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
        salesdocument = '2500000217'
* ORDER_HEADER_IN =
       order_header_inx = i_order_header_inx
* SIMULATION =
       behave_when_error = ' '
       int_number_assignment = ' '
* LOGIC_SWITCH =
       no_status_buf_init = ' '
   TABLES
       return = i_return
       order_item_in = i_order_item_in 
       order_item_inx = i_order_item_inx
       <b>SCHEDULE_LINES = lt_schdl
       SCHEDULE_LINESX = lt_schdlx.</b>



Hope this is helpful!.

Vasanth

Read only

Former Member
0 Likes
1,507

thanks Rich it worked..