cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi_pr_create - Value additional fields when Overall limit is used

0 Kudos

Goodmorning everyone, I'm stuck with a BADI.

When i try to load a Purchase requisition through BAPI_PR_CREATE , I can not fill two additional fields (Begin accural date - End accura date).

I valued the extensionin structures, appending the fields using the structure BAPI_TE_MEREQITEMX.

Everything works except when I try to load a PR with type position PSTYP = 1 (Overall limit valued).

what should I do?

Thank you all.

Greetings

Accepted Solutions (0)

Answers (3)

Answers (3)

SimoneMilesi
Active Contributor
0 Kudos

Hi Giuliano,

what do you mean with

Everything works except when I try to load a PR with type position PSTYP = 1 (Overall limit valued).

?

You got some return error? Or just the fields are not updated?

Do you implemented some BAdI or customer function on Purchase requisitions which can influence the behaviour?

I suggest you, as first step, to put a break point here where the extensions are managed

and here where you can catch some messages

and follow in debug the code to check what's going wrong.

Sadly, being custom fields, it's hard to replicate your scenario.

0 Kudos

Thank you Simone

I mean:

I put the value B into the field Item category of my file. In this case I can't value correctly the item quantity and the additional fields (date accural start date accural end) are non valued.

I put value space (defalut) into the same record of the same file and I can see the correct quantity and the dates are valued.

When i debug, the structures are correctly filled... and I have no error...

SimoneMilesi
Active Contributor
0 Kudos

Hi Giuliano,

but i'm wrong or leaving the same field blank or filled with 'B' should be the same?

If in ME51N i leave empty

it's converted into B

0 Kudos

This is a Purchase requisition where I insert limits

When i put B the fields are non correctly valued

Thanx.

0 Kudos

I found out that the quantity, in this case, is always valued with 1 (It is the same in ME51N).

Remains the problem of additional fields not valued.

SimoneMilesi
Active Contributor
0 Kudos

Ok, one down, one left 🙂

For the custom fields, did you debug the points i showed in my reply? It's in that point the extensionin are managed.

If you go step by step you should find why they are not filled.

You can also try with a watchpoint after the Z fields are filled to see where they are set blank.

0 Kudos

Hi Simone,

debugging in that point, the structures are correct and I don't have any error

I tried to use BAPI_PR_CHANGE to update those fields after creation of PR but the result is the same...

Maybe the solution is an update into EBKN...

Thanx!

SimoneMilesi
Active Contributor
0 Kudos

Attention! You should check the destination structures, not the Extensionin in input!

0 Kudos

Thank you Jürgen.

Yes, I'm talking about Z-fields (Begin accural date - End accural date).

It works for item category "Standard" (not valued).

Testing in ME51N, I can insert the fields... It works...

JL23
Active Contributor
0 Kudos

you are talking about Z-fields?

You said it did not work for PSTYP = 1 , did it really work for other item categories?

have you tested this specific case already in ME51N? did it work?