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: 

EXIT_SAPLIEDI_001 - How can i get order type into this user exit

Former Member
0 Kudos
607

Hi ,

I am working on user exit : EXIT_SAPLIEDI_001 (Include ZXF06U01). I am replacing a GL Account number with a different account number in this user exit.

I need to replace GL account only for one particular oder type. But Order Type is not available in this user exit to do a check for order type.

Is there a way to get order type?.

Atleast if i can get the reference document number(BKPF-XBLNR) based on that i can get sales document info(order type)..

Is there a function module?

Any suggestions on this helpful.

Thanks

1 ACCEPTED SOLUTION

valter_oliveira
Active Contributor
0 Kudos
187

Hello.

In debug, check which is the program that calls the exit. If the field you want is not a parameter to your exit, but is a variable of one of the standard programs that are being executed in that action, you can get the values this way (suposing that program 'SAPPROG' is the one that calls your exit and contains value of BKPF-XBLNR.


FIELD-SYMBOLS: <xblnr> TYPE xblnr,
DATA: name(30) VALUE '(SAPPROG)BKPF-XBLNR'.
ASSIGN (name) TO <xblnr>.

EDIT

I was looking for the program that calls your exit and found this:

(LIEDIF2T)XBBKPF-XBLNR

Regards,

Valter Oliveira.

Edited by: Valter Oliveira on Jul 10, 2008 6:10 PM

12 REPLIES 12

Former Member
0 Kudos
187

you can not change the import/export parameters of the user exit. you will need to find a new one which will have the data you need or if available, I would suggest using implicit enhancements.

thanks

0 Kudos
187

Thanks for your response. Could you please provide me an example. That will be helpful..

valter_oliveira
Active Contributor
0 Kudos
188

Hello.

In debug, check which is the program that calls the exit. If the field you want is not a parameter to your exit, but is a variable of one of the standard programs that are being executed in that action, you can get the values this way (suposing that program 'SAPPROG' is the one that calls your exit and contains value of BKPF-XBLNR.


FIELD-SYMBOLS: <xblnr> TYPE xblnr,
DATA: name(30) VALUE '(SAPPROG)BKPF-XBLNR'.
ASSIGN (name) TO <xblnr>.

EDIT

I was looking for the program that calls your exit and found this:

(LIEDIF2T)XBBKPF-XBLNR

Regards,

Valter Oliveira.

Edited by: Valter Oliveira on Jul 10, 2008 6:10 PM

0 Kudos
187

Hi Valter,

i tried as you mentioned

Function Module: IDOC_INPUT_INVOIC_FI

FIELD-SYMBOLS: <xblnr> TYPE xblnr.

DATA: name(16) VALUE '(LIEDIF2T)XBBKPF-XBLNR'.

ASSIGN name TO <xblnr>.

But the structure is not populated itself...XBBKPF..

Thanks,

Renu.

Edited by: renuka tadishetti on Jul 10, 2008 9:09 PM

0 Kudos
187

Hi renuka,

Try the program name: SAPLIEDI

FIELD-SYMBOLS: <xblnr> TYPE xblnr.

DATA: name(16) VALUE '(SAPLIEDI)XBBKPF-XBLNR'.

ASSIGN name TO <xblnr>.

Regards,

ravi

0 Kudos
187

Hi Ravi,

I tried it out.

It's the samething. Structure is not populated.

Thanks,

Renu.

0 Kudos
187

Hi again.

Insert a break-point where your exit is called (se37, your exit function, where-used-list ...), just before statement:


CALL CUSTOMER FUNCTION 'EXIT...'

Then, in debug, globals tab, find a variable that is populated with what you need. After that, use it with the same techinque in you exit.

Regards.

Valter Oliveira.

0 Kudos
187

Hi Vlater,

The information i needed was not populated...i need the reference document number (BKPF-XBLNR).

If i have this reference document number i can get the order type using the below logic:::

it is same as the Subsequent sales and distribution document (VBFA-VBELN).

Get the field VBFA-VBELV for the line item with field VBFA-VBELN, which is sales doc number in VBAK-VBELN. Form this line you can get the sales doc type (VBAK-AUART).

I am still trying to find from where to get the reference document number.

Thanks,

Renu.

0 Kudos
187

(SAPLIEDI)IDOC_DATA-SDATA

sdata has xbelnr (reference document number in it)

Issue resolved.

Thank You all for your help!

0 Kudos
187

hi:

I got the same problem.how to deal with it?could you tell me the detail?

thank you.

0 Kudos
187

Hi Renuka

I'm getting the same issue.

Can you please let me know how to solve this.

Thanks

Senthil.

Former Member
0 Kudos
187

Hi,

Check for an exit where you can export the order type or the reference document number. Then in the EXIT_SAPLIEDI_001 (Include ZXF06U01) you can import the same and use it for your purpose. Once you are done you can clear the memory id.

Thanks.