07-30-2008 9:27 AM
Hi,
before we upgraded to sap ecc 6, we checked in the exit ZXM06U43 for sy-tcode = ME28 in order to detect we were running BAPI_PO_RELEASE (the bapi itself tries to set sy-tcode = ME28 for PO). It worked perfectly before the upgrade, but now it seems that the sy-tcode can't be forced anymore.
Is there another way to detect we are releasing a PO with that bapi instead of checking for sy-tcode = ME28?
thanks in advance!
-francesco
07-30-2008 9:32 AM
Check if the value of the variable T180-TRTYP
'H' - Create
'V' - Change
'A' - Display
The above rule works in sales exits, i'm not sure if it works in your case.
07-30-2008 9:46 AM
Thanks for reply, Rajesh. I'm not sure of understand what you mean. Could you explain better how should I check the value of T180-TRTYP to detect if bapi_po_release is running?
thanks
francesco
07-30-2008 10:16 AM
>
> Thanks for reply, Rajesh. I'm not sure of understand what you mean. Could you explain better how should I check the value of T180-TRTYP to detect if bapi_po_release is running?
>
> thanks
> francesco
Please, check this part of the note 415716
It is often necessary to distinguish between the different processing statuses of the delivery because the exit is run both when creating and changing deliveries. You can use the following indicators to determine the processing status of the delivery:
Create, change or display?
The field T180-TRTYP has the value 'H' in creation mode, the value 'V' in change mode and the value 'A' in display mode.
It seems like you cannot meet your requirement with this approach.
07-30-2008 9:45 AM
Hi Francesco,
can u clarify your problem.As my friend mentioned u can use the variable I_TRTYP in the exit.But i didnt understand, why u dont see the sy-tcode.What is the value of sy-tcode in the exit.
best regards,
Burak
07-30-2008 9:47 AM
Check ekko-bstyp = 'F' .
Lets see if it works for you.
Regards
Neha
07-30-2008 9:51 AM
Thanks you all. But what I need is detecting from the exit if I'm releasing a PO through BAPI_PO_RELEASE.
The bapi itself tries to set sy-tcode to ME28, and in the past we checked for sy-tcode = ME28 in order to know how the PO is being released. But the new sap release seems not to allow forcing of sy-tcode, even if a standard bapi tries to do it.
Now I need another way to detect if I'm releasing a PO from the bapi. How do I do that?
thanks
francesco
07-30-2008 10:51 AM
A closer look at SYST structure and some R nD may solve this.
In Debugger, Check if Sy-CPROG is different when called thru' BAPI vs released normally {through front end xsn- or non-BApi}. also watch SY-MSGID - in case that is an indirect giveway for BAPI vs non-BAPI call.
Sy-UNMAE is another , if BAPIs get run from particular User name only.
Even SY-UCOMM may be different, for all U know.
You could also use sybatch - the flag for program running in bkground mode if the BAPI call is aways bkgnd.
Any feasible combination of above checks will definitley let you distinguish.
Else a different approach:
Raise an event by code after the BAPI call. Catch that event to trigger whatever other action you want to trigger [by a job step that awaits that event].
Regards
Sasanka