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: 

tax classification data

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

10 REPLIES 10

Former Member
0 Kudos

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

0 Kudos

hi Kiran,

What Sudha said is correct ... that FORM..ENDFORM is not permitted in USER-EXIT.

Regards,

Santosh

0 Kudos

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....

0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.