Application Development 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: 

Docmentation for SD_CUSTOMER_MAINTAIN_ALL

Former Member
0 Kudos

Hello,


I browsed that forum to found an idea to create a prospective customer. Many posts had e reference to

SD_CUSTOMER_MAINTAIN_ALL . But I didn't found any description for the parameters of this function module. Is there any description. Could you gave me a hint for that


Best regards


Veronika Hermenau

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor

Use class CMD_EI_API and its method MAINTAIN_BAPI. The method is documented.

19 REPLIES 19

Former Member
0 Kudos

Two things you can try:

Log on in German and see if there is any German documentation.

Do a where used list to see how SAP calls it.

Rob

0 Kudos

I've tried both,


There is no documentation in German even in English and use evidence leads only to one use in standard programs. The function module me be called indirect.

So I'll try to use call transaction xd01 .

Veronika

kesavadas_thekkillath
Active Contributor

Use class CMD_EI_API and its method MAINTAIN_BAPI. The method is documented.

0 Kudos

I tried this  methode, customer was created , but the communication data (telefon, fax, email) weren't added.  I filled the subtables for phone, fax and smtp, but

I'm not sure if there are any  parent structure fields to be filled to mark the subtables as filled. Unfortunately, I haven't  found any indication of that in the description of the method.

Do have an idea or hint for me about this

Veronika

0 Kudos

I am out of office. I will confirm it to you tomorrow. I am sure that it can be done.

0 Kudos

Each communication data structure has a field indicator ( I,U,D) to be marked. Have you populated that ?

You can also check with a where used list to know how this values are mapped. Please debug the private method CUSTOMER_ADDRESS which gets called internally, so that you will get to know the value mapping expected.

0 Kudos

I filled the indicator  last time, but it seems,  I took the false structurefield . I tried tel_no instead of telephone and the same in case of fax . And now I also added the country  in both cases.

No it works properly. Thank you for your advice guidance

Veronika

0 Kudos

Hi,

Just a request. In SCN there is no wiki or article that demonstrates the use of this class and method. I used it some time ago but it doesn't include all functions. It would be very nice of you sharing the source code as an article in SCN, so that it will help others.

0 Kudos

I can do so but I'm not sure how,  Should I do it as blog or discussion or document, or  as attachment of this discussion

0 Kudos

Hi Veronika,

In right side of this link http://scn.sap.com/community/abap you can see the options like "start a discussion", "write a document etc. Just create a document with required theory & code content & submit it, so that it gets tagged with abap development.

Once its posted, the FAQ "FM to create Customer" will be reduced to some extent

Happy posting & please share more ideas if any

FYI : There is a similar class for vendor creation VMD_EI_API, The structures & signatures are almost same for both. There is a parameter in each structure which indicates complete/Incomplete data indicator. While creating a new customer/vendor this field has no importance. While changing customer/vendor then this field has importance,for ex: if you are changing only a field value then this field must be passed space, if you are changing all the fields then this field must be passed X.

i.e. If you need to change partial fields and if you pass space X , the rest of the data in standard tables will be overwritten by space. Hope you understood.

Kesav

0 Kudos

Hello Kesav,

Have you ever tried  to extend a vendor with purchasing organization using vmd_ei_api ?
I've managed to create a vendor with one p.org.  Now I'm trying to assign another p.org, supplying mandatory partner functions, but I always get message :

Vendor 405: Mandatory partner role VN is missing for purchasing org. 3000


Here is a piece of code for it, purchasing organization 1000 already exists with the same partners

I would be very grateful for any suggestion.

REPORT /abbmdwf/ztestwk.


DATA : vendor     TYPE vmds_ei_main,

simulation TYPE char1,

vendor_ok TYPE vmds_ei_main,

vendor_err TYPE vmds_ei_main,

vendor_ok_message TYPE cvis_message,

vendor_err_message TYPE cvis_message.


DATA v TYPE vmds_ei_extern.

DATA postal TYPE cvis_ei_1vl.

DATA p TYPE vmds_ei_purchasing.

DATA f TYPE vmds_ei_functions.


v-header-object_task = 'U'.

v-header-object_instance-lifnr = '0000000405'.

v-central_data-central-data-ktokk = '0001'.


p-task = 'I'.

p-data_key-ekorg = '3000'.

p-data-verkf = 'qq verk'.


f-task = 'I'.

f-data_key-parvw = 'LF'.

f-data-partner = '0000000405'.


APPEND f TO p-functions-functions.

APPEND p TO v-purchasing_data-purchasing.

APPEND v TO vendor-vendors.


SET UPDATE TASK LOCAL.


CALL METHOD vmd_ei_api=>maintain_bapi

EXPORTING

iv_test_run = simulation

iv_collect_messages = 'X'

is_master_data = vendor

IMPORTING

es_master_data_correct = vendor_ok

es_message_correct = vendor_ok_message

es_master_data_defective = vendor_err

es_message_defective = vendor_err_message.


IF vendor_err_message-is_error IS INITIAL.

COMMIT WORK.

ENDIF.

REPORT /abbmdwf/ztestwk.


DATA : vendor     TYPE vmds_ei_main,

simulation TYPE char1,

vendor_ok TYPE vmds_ei_main,

vendor_err TYPE vmds_ei_main,

vendor_ok_message TYPE cvis_message,

vendor_err_message TYPE cvis_message.


DATA v TYPE vmds_ei_extern.

DATA postal TYPE cvis_ei_1vl.

DATA p TYPE vmds_ei_purchasing.

DATA f TYPE vmds_ei_functions.


v-header-object_task = 'U'.

v-header-object_instance-lifnr = '0000000405'.

v-central_data-central-data-ktokk = '0001'.


p-task = 'I'.

p-data_key-ekorg = '3000'.

p-data-verkf = 'qq verk'.


f-task = 'I'.

f-data_key-parvw = 'LF'.

f-data-partner = '0000000405'.


APPEND f TO p-functions-functions.

APPEND p TO v-purchasing_data-purchasing.

APPEND v TO vendor-vendors.


SET UPDATE TASK LOCAL.


CALL METHOD vmd_ei_api=>maintain_bapi

EXPORTING

iv_test_run = simulation

iv_collect_messages = 'X'

is_master_data = vendor

IMPORTING

es_master_data_correct = vendor_ok

es_message_correct = vendor_ok_message

es_master_data_defective = vendor_err

es_message_defective = vendor_err_message.


IF vendor_err_message-is_error IS INITIAL.

COMMIT WORK.

ENDIF.

0 Kudos

Hi Witold,

I havent added a P.Org using this method, but i have deleted P.org for vendors using this method. I donot have access to SAP system to cross check it.

Few questions:

Did you try the same through standard tranasction, is it working fine ?

If I remember properly, In the last part of this method documentation, I have read something related to this. Please read it once.

I can try it tomorrow

Not Active Contributor

0 Kudos

I've read lots of your comments on documentation for cmd_ei_api / vmd_ei_api but I cannot find any documentation for this. Could you help me locate it?

I would be very grateful for help with this. I'm stuck since Friday trying to make it work

And yes I've done it in XK01 (addition of 3000 p.org.)

thanks,

Witold.

0 Kudos

Place the cursor on method maintain_bapi, in the menu check for component->documentation.

0 Kudos

Hi Kesav,

Will you have a time to check my code?  PLEASE?

Maybe you have an example of your solution how to add purchasing organization?

Or alternative to this BAPI ?  (that would be inconvenient, but if the BAPI will not work...)

Thanks.

0 Kudos

Please ... ?

0 Kudos

Finally I did it. 

CURRENT_STATE flag is needed to set it to X if you are inserting a new records for partner functions

The path for the flag :

VENDOR-PURCHASING_DATA-PURCHASING-CURRENT_STATE

I'm happy now....


I know you mentioned this field before but you've said that it has no meaning for insert,
which is the case here, but it is required to work properly in this case also .

That's strange - I'm sure I haven't such problems with sales area for customer.

Anyway, it works.

0 Kudos

I was looking into it. In my previous comment I have mentioned a field called "CHANGE INDICATOR" . Its actually CURRENT_STATE which you noted now. I was seeking access to ECC 6.0 all these while to help you. What ever I wrote above was from my idea which I did long before. Nice to know that you got it.

Kesav

0 Kudos

Hello Witold,

I am trying to create vendor with partner functions using this class.

I have 3 partner functions that are mandatory.

In XK01 during manual creation, the partner numbers are filled INTERNAL & after saving, it is replaced by the vendor number being generated. I face issues when trying this via maintain BAPI method.

I fill all the current state = 'X' , when I do not fill the partner number (which is the requirement), I get message to fill a partner number.

Do you have any idea on this?

Regards

Seema M