cancel
Showing results for 
Search instead for 
Did you mean: 

How to define null or empty value in BAPI function modules?

Former Member
0 Kudos

Hi,

I have problem with BAPI functions, where some parameters are mandatory.

For example: when I try to use HR BAPI's(BAPI_PERSDATA_CHANGE, etc.) I have to insert parameters like SUBTYPE,OBJECTID,LOCKINDICATOR. The PA0002 table that is used from this BAPI doesn't have SUBTYPE, OBJECTID, LOCKINDICATOR, for any of the records that I would like to select.

So what I tried, was to put a ' ', to indicate that is empty. It returned an error message saying "Make an entry in all required fields". Next tried to put in some values for these fields -- and it returned an error message saying "No data selected from 0002 for this period".

I also tried to run BAPI_FAMILY_CHANGE that uses data from table PA0021. Here I found some records with SUBTYPE, OBJECTID fields that were not empty, but LOCKINDICATOR was still missing. So I tried to put LOCINDICATOR value directly in to database (with MS SQL Enterprise Manager). After that I was able to use BAPI_FAMILY_CHANGE.

I think that manually inserting data in database is not normal procedure.

Is there something that I have missed out?

I mean -- how can I get this to work without inserting data directly in database?

How can I define null or empty value in BAPI function modules?

Thank you in advance.

Best regards,

Mihail

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Defining an empty value for a parm in a table is easy.

First get the function's definition from the SAP system

Second only populate the fields for which you have a value to set

Third execute the function.

The JCO takes care of the rest.

Enjoy

Former Member
0 Kudos

Thank you for your help.

Best regards,

Mihail