2015 Mar 31 3:56 PM
Hi experts
How could i create a new parameter in a 'BAPI_PO_CREATE1'.?
I have a variable v_x with value 11111111 i want get this value in exit called inside this bapi.
I was using import export but i have problems with parallel process (fail) .
Thanks for help.
2015 Mar 31 5:51 PM
Hi,
Create a new function module (EX: ZBAPI_PO_CREATE1)
call BAPI_PO_CREATE1 inside this function module
declare global variable in the new funtion module ( v_x = 11111111 )
goto the exit.
FIELD-SYMBOLS: <FS_VX> TYPE xxxxx.
ASSIGN ('(SAPLyourfunctiongroupname)v_x') to <FS_VX>.
now <FS_VX > will have the value 11111111 .
you can use it in the exit.
Regards
Velraj
2015 Mar 31 4:08 PM
Create your own Z function module with the same interface as BAPI_PO_CREATE1 but with your additional parameter. The Z function module uses IMPORT/EXPORT then calls the BAPI.
In the part of your program that controls parallel runs, call the Z FM instead of the BAPI.
2015 Mar 31 5:51 PM
Hi,
Create a new function module (EX: ZBAPI_PO_CREATE1)
call BAPI_PO_CREATE1 inside this function module
declare global variable in the new funtion module ( v_x = 11111111 )
goto the exit.
FIELD-SYMBOLS: <FS_VX> TYPE xxxxx.
ASSIGN ('(SAPLyourfunctiongroupname)v_x') to <FS_VX>.
now <FS_VX > will have the value 11111111 .
you can use it in the exit.
Regards
Velraj
2015 Mar 31 8:25 PM
2015 Apr 01 6:59 AM
Using field symbols in this way works, but it isn't good programming as:
1. it relies dynamically on the name of your function module - it can't be syntax checked.
2. It breaks encapsulation
3. It's a bit of a hack.
4. It's unnecessary when you've got your own Z function module to play with!
Far better (syntactically checkable, easy to understand, good modularisation) would be to add a function module in the same function group as your ZBAPI_PO_CREATE1, which returns the value of your global variable. You can call that from inside the exit.
2015 Apr 01 8:10 AM
Hi Matthew
Thanks for pointing it out.
i will keep this in my mind..
Thanks
Velraj
2015 Apr 01 8:28 AM
If you're working in a OO environment, you can use class attributes and methods to achieve the same kind of thing.