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

Maintain customer Partner Functions with specific field (structure append)

Former Member
0 Kudos
2,284

Hi gurus,

i created a structure append into the table KNVP, i add only one field (ZZmyfield). OK. Now i would like to maintain partner functions with BAPI standard taking into account my specific field.

Thanks for your help

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Kudos
1,151

Did you try the API class CMD_EI_API, method MAINTAIN_BAPI (look at CUSTOMERS[]-SALES_DATA-SALES[]-FUNCTIONS, deep structure parameter, and use search tool for samples of cmd_ei_api=>maintain_bapi.)

Hint: You have to add your field to structures CMDS_EI_FUNCTIONS_DATA and CMDS_EI_FUNCTIONS_DATAX (BAPIUPDATE) too (Look at Method EXTERN_FORMAT_SALES_DATA of class CMD_EI_API_MAP_STRUCTURE)

Regards,

Raymond

11 REPLIES 11
Read only

Former Member
0 Kudos
1,151

Hi,

Create a batch input and call transaction XD02.

You must use function CUSTOMER_UPDATE.

Regards.

David Cárceles.

Read only

0 Kudos
1,151

Don't suggest the use of an update FM as CUSTOMER_UPDATE (which perform almost no check and directly update database)

Regards,

Raymond

Read only

ŁukaszPęgiel
SAP Champion
SAP Champion
0 Kudos
1,151

If you like to create/update customers I would suggest to use cmd_ei_api=>maintain_bapi. It's a bit complicated at first look, but it's really powerful. If you would like to update your Z-fields with this method then you would need to append also your Z-field to the structures used by this method.

Cheers

Łukasz

Read only

RaymondGiuseppi
Active Contributor
0 Kudos
1,152

Did you try the API class CMD_EI_API, method MAINTAIN_BAPI (look at CUSTOMERS[]-SALES_DATA-SALES[]-FUNCTIONS, deep structure parameter, and use search tool for samples of cmd_ei_api=>maintain_bapi.)

Hint: You have to add your field to structures CMDS_EI_FUNCTIONS_DATA and CMDS_EI_FUNCTIONS_DATAX (BAPIUPDATE) too (Look at Method EXTERN_FORMAT_SALES_DATA of class CMD_EI_API_MAP_STRUCTURE)

Regards,

Raymond

Read only

Former Member
0 Kudos
1,151

Hi all,

thanks a lot for your help.

I use class CMD_EI_API~MAINTAIN_BAPI() and it's work fine for standard field.


Now I do not know how to feed my specific field. I took a look at the class CMD_EI_API_MAP_STRUCTURE and method EXTERN_FORMAT_SALES_DATA but don't know what i should do. Do you have a wiki or sample code ?


Edit : in fact, method EXTERN_FORMAT_SALES_DATA is private...

Regards,

Eric

Read only

0 Kudos
1,151

I only mentionned Method EXTERN_FORMAT_SALES_DATA as it's the method where data are mapped, and for partner it uses a MOVE-CORRESPONDING statement.

Regards,

Raymond

Read only

0 Kudos
1,151

Ok but how can i use it ?

Read only

0 Kudos
1,151

As already written, append your zzfield to CMDS_EI_FUNCTIONS_DATA, fill it in your report and set a break-point in mapping method.

Read only

0 Kudos
1,151

Sorry to insist, but this structure CMDS_EI_FUNCTIONS_DATA contains the following fields:

DEFPA1 TypesDEFPACHAR10Default Partner
KNREF1 TypesKNREFCHAR300Customer description of partner (plant, storage location)
PARTNER1 TypesGPANRCHAR100Number of an SD business partner

Where can i append my zzfield ?

Read only

0 Kudos
1,151

SE11, click on "Append structures" (no sscr key required, and Enhancement category is "can be enhanced (character type)"

Regards,

Raymond

Read only

0 Kudos
1,151

Oh yes ok ! Structure append with my zzfield, and the move-corresponding instruction will do the job mapping.

Sorry, i'm so tired