cancel
Showing results for 
Search instead for 
Did you mean: 

Populate Z fields or extension on BAPI

former_member184566
Active Contributor
0 Kudos

Hi

I'm adding a sales order using VC, adds the sales order fine.

But now there are custom fields we have added in SAP on the sales order screen. Need to populate these trhough VC.

I'm using BAPI_SALESORDER_CREATEFROMDAT2, the custom fields are meant to be populated via tables paramter extensionin.

But the problem is I have to pass a structure type, then a structure with all the values. So if I did this in ABAP I would have a internal table and pass this along. How do I do this in VC???

Or is there another way to update these fields?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

mh97
Contributor
0 Kudos

Hi Louis,

I have done something similar with purchase requisitions and Adobe forms. It should work for VC the same way I think.

The ExtensionIn structure of the BAPI import parameters is what you need to fill. I think you should be able to pass your structure name directly to the field EXTENSIONIN-STRUCTURE. Then you need to pass to EXTENSIONIN-VALUEPART1, a concatenated string that has the field values for your structure in the appropriate positions with spaces as filler if needed.

so for example if your structure is something like

field1 CHAR5

field2 CHAR2

field3 CHAR30

and your values are

field1 'test'

field2 empty

field3 'a'

you would pass

"test   a"

where there are 3 spaces between "test" and "a".

Does that make sense? It's been a while since I did this but I am pretty sure this is the way it's done.

Hope it helps.

Margaret

former_member184566
Active Contributor
0 Kudos

Hi

Yes, this makes a lot of sense. I have tried this in VC, still not adding with these fields.

But if I do it in SAP, in a program that calls the bapi. I populate like you say it then works.

So in ABAP works as you suggested, but through VC it is not.

Also how do you join several fields together in VC to make the string value as you suggested?? In ABAP it is easy.

Thanks in advance

Former Member
0 Kudos

Hi

In VC you can join 2 fields with '&' Syntax will look like below -

(If you want to show number as text then add 'CHR' or else remove that part.)

(CHR('@Field1)'&'CHR(@Field2'))

Regards

Sandeep

Answers (0)