‎2006 Mar 16 10:52 AM
hi im trying to populate the tax classification data ( order --> header --> sales vbak-taxk1). im using exits to do this im using exit EXIT_SAPLVEDA_001 to read the data from idoc and ive debugged it and it seems its carrying the field into stucture xvbak and after that its not showing up in the order when getting created. so i thought of using exit EXIT_SAPLVEDA_002 and just wrote code like this to populate the data into bdc.
data: begin of bdcdata occurs 500.
include structure bdcdata.
data: end of bdcdata.
data: begin of xvbak.
include structure vbak.
data: end of xvbak.
if not xvbak-taxk1 is initial.
perform dynpro using 'SAPMV45A' '4002' 'X' 'VBAK-TAXK1' xvbak-taxk1.
endif.
form dynpro using value(p_0137)
value(p_0138)
value(p_0139)
value(p_0140)
p_xvbak_taxk1.
clear bdcdata.
bdcdata-program = p_0137.
bdcdata-dynpro = p_0138.
bdcdata-dynbegin = p_0139.
bdcdata-fnam = p_0140.
bdcdata-fval = p_xvbak_taxk1.
append bdcdata.
endform. " dynpro
but when trying to activate it its showing me an error couldnt figure out how to resolve it. any sughestions.
error
Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION". -
thanks,
Kiran.
‎2006 Mar 16 12:54 PM
Hello Kiran,
As u have indicated that u can c the structure populated in ur user exit. I can suggest u set up a watchpoint to c where exactly it is getting cleared.
‎2006 Mar 16 10:55 AM
Inside a user-exit, a FORM..ENDFORM is not permitted. I suggest you replace the PERFORM statement with the actual code. It should work.
Hope this helps.
Sudha
Message was edited by: Sudha Mohan
‎2006 Mar 16 11:00 AM
hi Kiran,
What Sudha said is correct ... that FORM..ENDFORM is not permitted in USER-EXIT.
Regards,
Santosh
‎2006 Mar 16 11:07 AM
i have done it its working. but still the field is not getting populated in the order created. anything wrong with my coding ...
thanks a lot....
‎2006 Mar 16 11:45 AM
Hi,
I am not sure but is a BDC required?
Try the user exit USEREXIT_MOVE_FIELD_TO_VBAK.
Here you can directly change the Tax classification.
Regards,
Shashank
‎2006 Mar 16 11:52 AM
shashank,
thanks a lot for the info. but when i checked oss notes regarding this problem there they suggested to work it out like this. is that user exit in idoc_input_orders. can u let me know how i can use it. im new to user exit concept. plz let me know how to do this.
thanks a lot.
‎2006 Mar 16 12:03 PM
Hi,
What i can suggest you is you export the tax classification indicator (VBAK-TAXK1) to memory in the user exit in which you process the IDOC.
Then, in the exit USEREXIT_MOVE_FIELD_TO_VBAK,
import this indicator from memory and pass it to XVBAK.
Hope it helps..
Regards,
Shashank
‎2006 Mar 16 12:22 PM
ohh ive done it . ipaased it into the structure dxvbak and it is showing up in the structure while debugging and when creating the order its nor populating the field in the order. dont know wat the problem is.
thanks
‎2006 Mar 16 12:54 PM
Hello Kiran,
As u have indicated that u can c the structure populated in ur user exit. I can suggest u set up a watchpoint to c where exactly it is getting cleared.
‎2006 Mar 16 2:18 PM
hi all,
im using a bdc to populate the field. i dont know where im getting it wrong. i couldnt catch it in debugging. could somebody see the logic i have written and let me know if there is anything wrong with it. is it all we populate in bdc r is there any other field to populate into bdc.
thanks everybody for their support.
‎2006 Mar 16 2:18 PM
code
data: begin of bdcdata occurs 500.
include structure bdcdata.
data: end of bdcdata.
data: begin of i_xvbak occurs 0.
include structure vbak.
data:end of i_xvbak.
move dxvbak to i_xvbak.
append i_xvbak.
sort i_xvbak by vbeln auart kunnr.
loop at i_xvbak.
clear bdcdata.
bdcdata-program = 'SAPMV45A'.
bdcdata-dynpro = '4002'.
bdcdata-dynbegin = 'X'.
bdcdata-fnam = 'VBAK-TAXK1'.
bdcdata-fval = i_xvbak-taxk1.
append bdcdata.
endloop.