Application Development and Automation 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: 
Read only

input new parameter in BAPI standard.

ronaldo_aparecido
Contributor
0 Likes
1,481

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.

1 ACCEPTED SOLUTION
Read only

arkantos
Explorer
0 Likes
1,140

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

6 REPLIES 6
Read only

matt
Active Contributor
0 Likes
1,140

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.

Read only

arkantos
Explorer
0 Likes
1,141

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

Read only

0 Likes
1,140

Thanks Worked!!!!

Read only

matt
Active Contributor
0 Likes
1,140

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.

Read only

0 Likes
1,140

Hi Matthew

Thanks for pointing it out.

i will keep this in my mind..

Thanks

Velraj

Read only

matt
Active Contributor
0 Likes
1,140

If you're working in a OO environment, you can use class attributes and methods to achieve the same kind of thing.