Application Development 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: 

EDI Orders - Inbound, Orders05 - Enhancements to Additional Data B

Former Member
0 Kudos

Hi Folks,

I have ZORDERS message type coming to SAP which creates Sales Order ( extension of basic type orders05 ) . I have created new ZVBAK segment which carries additional data to the standard vbak table. I have added append structure in vbak table to hold these zfields.

I have modified the Additional Data B - 8309 screen of SAPMV45A to have these values displayed in va01/va02/va03. I could able to update/change/delete these additional data in va01/va02/va03.

Problem:

I'm not able to update the additional data b screen while using ZORDERS message.

I used EXIT_SAPLVEDA_001 to fetch the segment zvbak data and map it to DXVBAK structure. This logic is working fine. SAP is using Calling Transaction on Va01. Additional Data B logic is not getting populated in dynpro SAP is building.

Did anyone faced this issue? Any suggestions?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try adding the BACK command in the end.

STATICS: l_added TYPE xfeld.

  CHECK l_dded IS INITIAL.

* Ok code for addition B Screen.
  ls_vbak = dxvbak.
  dxbdcdata-fnam = 'BDC_OKCODE'.
  dxbdcdata-fval = '=KZKU'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.
 
* Additional data B screen
  dxbdcdata-program = 'SAPMV45A'.
  dxbdcdata-dynpro   = '8309'.
  dxbdcdata-dynbegin = 'X'
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.
 
* Populate data.
  dxbdcdata-fnam = 'VBAK-ZZJOC_DUTYATRIB'.
  dxbdcdata-fval = 'A'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

  dxbdcdata-fnam = 'BDC_OKCODE'.
  dxbdcdata-fval = '/EBACK'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

  l_added  = 'X'.

Thanks

Naren

14 REPLIES 14

ThomasZloch
Active Contributor
0 Kudos

My IDoc experience is a bit outdated, but I'll try.

I assume that you use the standard process code with function IDOC_INPUT_ORDERS behind?

In SE16 for VBAK, can you see whether the additional data has been filled at all?

Did you double check that the segment name you are checking for in EXIT_SAPLVEDA_001 is the exact same as it appears in the IDoc, including capitalization?

Thomas

P.S. meaningful subject, good explanation, an actual problem...I wish all question here were like this...

0 Kudos

Thanks Thomas.

Yes, I used standard process code ORDE.

SE16 additional data is not filled while creating orders through IDOC.

Segment Names are fine. i could able to change the dxvbak in EXIT_SAPLVEDA_001 . But the value is not carried through to the orders.

Former Member
0 Kudos

Hi,

Try this..

Use the exit EXIT_SAPLVEDA_002 to insert records to the BDC table..DXBDCDATA...with the screen data for Additional Data B ...

Thanks

Naren

0 Kudos

thanks Naren for the inputs.

I was trying this exit and i couldn't succeed in populate and post the idocs successfully.

This exit is getting called many times and the below code is executed many times.

I'm not sure how to control this.

If you have done this before, a sample code will help

IF dlast_dynpro = '4001'.

ls_vbak = dxvbak.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '=KZKU'.

APPEND dxbdcdata.

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro = '4002'.

dxbdcdata-dynbegin = 'X'.

APPEND dxbdcdata.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '/00'.

APPEND dxbdcdata.

dxbdcdata-fnam = 'BDC_CURSOR'.

dxbdcdata-fval = 'VBAK-ZZJOC_DUTYATRIB'.

APPEND dxbdcdata.

dxbdcdata-fnam = 'VBAK-ZZJOC_DUTYATRIB'.

dxbdcdata-fval = 'A'.

APPEND dxbdcdata.

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro = '4002'.

APPEND dxbdcdata.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '/EBACK'.

APPEND dxbdcdata.

ENDIF.

0 Kudos

hi Arun,

I had the issue with Enhancements to Additional Data B during the IDOC creation.

I had tried your codes but the Additional Data B screen still appear before the IDOC able to save. Any ideas? Appreciate your value inputs. Thanks in advance.

0 Kudos

Hi,

I have a similar requirement to add the data to the ADDITIONAL DATA B of this order, but during BDC processing, i am not getting the last_dynpro values as 4003.Any idea why I am not able to get this value?

Former Member
0 Kudos

EXIT_SAPLVEDA_002 is called during each screen processing. Make sure you don't create BDC data for screen 8309 for each screen called.

Manoj

Former Member
0 Kudos

Create a custom include ZXVEDTOP in the main include LXVEDTOP. Declare a variable in the custom include (say my_flag).

In the user exit 'EXIT_SAPLVEDA_002'. Fill the BDC data for the custom screen if the the variable.

if my_flag = space.

..... "Fill the BDC data

.....

my_flag = 'X'.

endif.

Re-set the global variable in EXIT_SAPLVEDA_009

0 Kudos

Thanks Monoj. I will try...

Former Member
0 Kudos

Hi,

Try this code..

IF dlast_dynpro = '4309'.  " If the last screen is additional data A

* Ok code for addition B Screen.
  ls_vbak = dxvbak.
  dxbdcdata-fnam = 'BDC_OKCODE'.
  dxbdcdata-fval = '=KZKU'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

* Additional data B screen
  dxbdcdata-program = 'SAPMV45A'.
  dxbdcdata-dynpro   = '8309'.
  dxbdcdata-dynbegin = 'X'
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

* Populate data.
  dxbdcdata-fnam = 'VBAK-ZZJOC_DUTYATRIB'.
  dxbdcdata-fval = 'A'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.  

ENDIF.

Hope this helps.

Thanks

Naren

0 Kudos

Naren,

Thanks for the sample code.

IF dlast_dynpro = '4309'. I'm not getting this screen in the user-exit. Following are screen i'm getting while debugging. 0101, 4001, 4002,4001,4003.

I gave your code without dlast_dynpro = '4309' and i'm getting idoc error as "Flow control: Entry SAPMV45B, KZKU, A0, * , * , * is missing in T185"

Former Member
0 Kudos

Hi,

Try adding the BACK command in the end.

STATICS: l_added TYPE xfeld.

  CHECK l_dded IS INITIAL.

* Ok code for addition B Screen.
  ls_vbak = dxvbak.
  dxbdcdata-fnam = 'BDC_OKCODE'.
  dxbdcdata-fval = '=KZKU'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.
 
* Additional data B screen
  dxbdcdata-program = 'SAPMV45A'.
  dxbdcdata-dynpro   = '8309'.
  dxbdcdata-dynbegin = 'X'
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.
 
* Populate data.
  dxbdcdata-fnam = 'VBAK-ZZJOC_DUTYATRIB'.
  dxbdcdata-fval = 'A'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

  dxbdcdata-fnam = 'BDC_OKCODE'.
  dxbdcdata-fval = '/EBACK'.
  APPEND dxbdcdata.
  CLEAR: dxbdcdata.

  l_added  = 'X'.

Thanks

Naren

0 Kudos

Naren, Thanks Again.

Following code worked. Only Change to your code is the screen number. program doesnt recognise the subscreen 8309. It recognises screen 4002. It populated in the screen.

Very happy to see this on the screen. I did the same thing for item level enhancement for vbap.

Both of them are working.

Hats off to you. Thanks!!

order header additional data b -Code......

-


STATICS: l_vbak_added TYPE xfeld,

l_vbap_added TYPE xfeld.

DATA: ls_vbap TYPE vbap.

IF dlast_dynpro = '4001'.

CHECK l_vbak_added IS INITIAL.

  • Ok code for addition B Screen.

ls_vbak = dxvbak.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '=KZKU'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Additional data B screen

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro = '4002'.

dxbdcdata-dynbegin = 'X'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Populate data.

dxbdcdata-fnam = 'VBAK-ZZJOC_DUTYATRIB'.

dxbdcdata-fval = ls_vbak-zzjoc_dutyatrib.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '/EBACK'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

l_vbak_added = 'X'.

ENDIF.

order item additional data b -Code......

-


IF dlast_dynpro = '4003'.

CHECK l_vbap_added IS INITIAL.

LOOP AT dxvbap.

  • Ok code for addition B Screen.

ls_vbap = dxvbap.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '=PZKU'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Additional data B screen

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro = '4003'.

dxbdcdata-dynbegin = 'X'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Populate data.

dxbdcdata-fnam = 'VBAP-ZZJOC_POSNR'.

dxbdcdata-fval = ls_vbap-zzjoc_posnr.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

ENDLOOP.

l_vbap_added = 'X'.

ENDIF.

Former Member
0 Kudos

good...Thanks for sharing the code that finally worked..

Thanks

Naren