2007 Jul 12 9:14 PM
We are using inbound IDoc ORDERS05 to create sales orders. Recently we've extended VBAP and added a Z... field, which is now maintained on 'Additional Data B' tab in VA01.
I've extended ORDERS05 as ZORDERS05 and added a segment (child of E1EDP01) with Z... field. Now I'm working on the user exits in VEDA0001 to push this field through. In the exit EXIT_SAPLVEDA_001 XVBAP (DXVBAP) is getting updated with Z... field and it's working fine. However, the field doesn't go to VA01 for some reason.
I debugged IDOC_INPUT_ORDERS - for the sales orders it fills in BDCDATA table with the screen and field information and then calls transaction VA01. Our Z.. field is not in BDCDATA table when VA01 is called.
BDCDATA table may be manipulated in EXIT_SAPLVEDA_002, but no matter what I do I'm only getting no Z field or error messages. The latest is "Field VBAP-Z.... does not exist in the screen SAPMV45A 4003". Well, when I create a recording for VA01 it is on the screen 4003. It is actually on subscreen 8459 but there is no field for subscreen number.
There is an old note 135984 where it looks like the field D_FLAG_P-PZKU might have something to do with the fields on "Additional Data B" screen, but there is no code whatsoever in the FM that looks at that field.
I searched everywhere and can't find a solution for this. Has anyone ever managed to fill in a VBAP-Z... field through this IDoc?
Thanks!
2007 Jul 23 4:13 PM
Thanks for your input, everyone!
I finally found a way to get the data through, but it was quite painfull. First of all, one would think that if DD_FLAG_P-PZKU = 'X' this would add an entry in BDCDATA with OK code = 'PZKU'. Well, this is not working. I ended up debugging the whole function module and - dig this - there is no code whatsoever for this field. I mean the field is there but it's not doing anything at all! What's the point then? (Markus, I'm curious if you used D_FLAG_K-KZKU? Did it work?)
By trial and error we figured out that OK code PZKU must be in the previous screen entry in BDCDATA, then we can add entries for screen 4003 with our VBAP Z field. I ended up using dd_flag_p-pde2 ='X' in EXIT_SAPLVEDA_001, which gave me an entry in BDCDATA with screen 4003 and OK code PDE2. Then in EXIT_SAPLVEDA_002 I'm looking for this entry, replacing PDE2 with PZKU, adding the data for Z field and then adding back PDE2 OK code.
If anyone finds a better solution let me know. When I sent a note to SAP that their field DD_FLAG_P-PZKU does not do anything they sent me to "consulting". Right...
2007 Jul 12 9:28 PM
2007 Jul 12 9:40 PM
Is this field added to the screen as well? Do you see it in VA01, VA02, and VA03?If so you should not get this error. Try to do a BDC on your own and see if you get the same error.
Also, it is not sufficient just to add this screen info to the BDC table, you have to include the corresponding BDCOKCODEs to come to this screen as well as get out of this screen. Are you doing all that?
Another thing to note is that the "PERFORM customer_function_dynpro" is called after every screen, so you have to make sure that your BDC information for the Z field is entered at the right time, not every time it is called.
2007 Jul 12 10:09 PM
I am using EXIT_SAPLVEDA_001 as stated above and that part is working. This exit is executed before BDC and is meant to fill in XVBAK/XVBAP. I've also tried filling in various fields in DD_FLAG_P in that exit, which didn't make much difference. There is no documentation available on that structure.
Srinivas, thanks for your response. The field does appear on VA01...3 and is working fine in the transaction. I did create a recording of an order in VA01 and then created a program for it from SM35 - it is also working fine with the screen 4003. This really beats me... Here is a fragment of that program where it goes from screen 4001 to 4003:
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T14'.
<bunch of standard fields here>
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-ZZ...'.
perform bdc_field using 'VBAP-ZZ...'
'05'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-ZZ...'.
perform bdc_field using 'VBAP-ZZ...'
'05'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
I've tried to re-create the same piece with all the OK codes but am still geting this error. Maybe OK codes are supposed to be different in FM? Any suggestions?
You're right - the PERFORM is called several times. Currently I'm trying to add BDC for this Z field right before OK code SICH (for saving) is executed. I've tried a different spot, but then I'm getting errors like "no data for screen 4001 or 4002".
2007 Jul 23 3:55 PM
Hi Jelena,
try to use 'BDC_OKCODE' 'PZKU' for the additional Posdata B Subscreen.
I did the same with 'KZKU' for additional Data B Header and it works.
2007 Jul 23 4:13 PM
Thanks for your input, everyone!
I finally found a way to get the data through, but it was quite painfull. First of all, one would think that if DD_FLAG_P-PZKU = 'X' this would add an entry in BDCDATA with OK code = 'PZKU'. Well, this is not working. I ended up debugging the whole function module and - dig this - there is no code whatsoever for this field. I mean the field is there but it's not doing anything at all! What's the point then? (Markus, I'm curious if you used D_FLAG_K-KZKU? Did it work?)
By trial and error we figured out that OK code PZKU must be in the previous screen entry in BDCDATA, then we can add entries for screen 4003 with our VBAP Z field. I ended up using dd_flag_p-pde2 ='X' in EXIT_SAPLVEDA_001, which gave me an entry in BDCDATA with screen 4003 and OK code PDE2. Then in EXIT_SAPLVEDA_002 I'm looking for this entry, replacing PDE2 with PZKU, adding the data for Z field and then adding back PDE2 OK code.
If anyone finds a better solution let me know. When I sent a note to SAP that their field DD_FLAG_P-PZKU does not do anything they sent me to "consulting". Right...
2010 Apr 16 11:08 AM
Hi Jelena,
Did you try the user exit USEREXIT_MOVE_FIELD_TO_VBAP in the program MV45AFZZ? I think this would have been much better.
Regards,
Vitz.
2015 Jul 06 12:22 PM
Hello Vitish,
Is the exit is working in your case? How you have passed the idoc data to exit( USEREXIT_MOVE_FIELD_TO_VBAP) mentioned of MV45AFZZ. Is it via Import export?
2015 Sep 03 3:19 AM
USEREXIT_MOVE_FIELD_TO_VBAP has nothing to do with this. This post is about passing data from the IDoc to application. Please refer to ROE and don't resurrect the old posts with additional questions, create your own discussion instead.
Well, at least this reminded me to close this discussion after 8 years.
2016 May 05 10:34 AM
Hello,
Can you provide the codes on how you did it?
I am having the same issue.
Thanks in advance.