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: 

SD_SALESDOCUMENT_CREATE for STCD1

Former Member

Good afternoon, Agreceria the person who can help me solve this issue.

I give the data RFC (STCD1) customers any CPD to the BAPI SD_SALESDOCUMENT_CREATE but can not find the section or table where will this data. I had commented that used the EXTENSIONIN table. Which is filled follows however is not favorable results. Example:

EXTENSIONIN-STRUCTURE = 'VBPA3KOM'

EXTENSIONIN-VALUEPART1 = '0000000000000000AGRFC801205TXX000' I have reviewed the FAQ similar issues, however I have not seen satisfactia answer. The subject that is equal to mine and give a reference solution using a User-Exist.

Lamentamente I can not use that solution because I do not have access to create / modify those sections so I must be necessarily indicate that the BAPI. If this message contains some fragment that violates the rules thank you for your understanding. I ask me ayueden to correct the content. In itself, I thank Matthew Billingham user by brindadas recommendations, however I did not find any solution in the FAQ.

If I knew the lnk where this solution can come, I really appreciate it.

Thanks everyone for your help.

11 REPLIES 11

Former Member
0 Kudos

Hi

STCD1 should be tax number of the customer? if it's so, it's customer master data, why do you need to transfer it in a sales order?

Max

Former Member
0 Kudos

This data is part of fiscal data that are captured for customers who are classified as possible and require invoice.
When a sale is created in the VA01 for such customers capture window opens to capture client fiscal data.
This data RFC (STCD1) is recorded in the table VBPA3 for these operations is not recorded in the customer master.

Thank you for answering.

Former Member
0 Kudos

Ok

so you mean one time customer?

It's right to move the data by EXTENSIONIN as you've written, but I can't understand why you can't use it

Max

Former Member
0 Kudos

It is right is a client of that type.
That's the detail, do not understand why it does not work if you implement that table and full as I think it should be.

No if necessary add an additional configuration or apply a note to affect the BAPI Sales.

IT_EXTENSIONIN_IN-STRUCTURE = 'VBPA3KOM'.
IT_EXTENSIONIN_IN-VALUEPART1 = '0000000000000000AGRFC801205TXX'.
APPEND IT_EXTENSIONIN_IN.

Reviewing the BAPI SD_SALESDOCUMENT_CREATE in SE37.
This is the routine that handles the EXTENSIONIN parameter table.

***perform ms_move_extensionin tables extensionin
sales_items_in
sales_schedules_in
using
sales_header_in.


***BAPI enhancement for CPD Customer Information for table VBPA3
WHEN 'VBPA3KOM'.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.
MOVE TO extensionin + lv_length wa_vbpa3kom.
Wa_vbpa3kom APPEND TO ex_vbpa3kom.
ENDCATCH.

Tx.

Former Member

Hi

Something is strange

Function SD_SALESDOCUMENT_CREATE transfers the data from extensionin to internal table EX_VBPA3KOM, but it doesn't use it

Theoretically the function should have to transfer the data to funcion SD_SALES_DOCU_MAINTAIN, but it doesn't do it, it seems the data are only appended to EX_VBPA3KOM.

,

Something is strange

I've checked the code of SD_SALESDOCUMENT_CREATE:

this function transfer the data from extensionin to internal table EX_VBPA3KOM (as you've shown) but it doesn't use it

That table should be transfered to function SD_SALES_DOCU_MAINTAIN, but it doesn't do it

It seems the data are appended to EX_VBPA3KOM only

Former Member
0 Kudos

I can't find a SAP note about it

but you can try to use the fm SD_PARTNER_UPDATE after calling the BAPI SD_SALESDOCUMENT_CREATE

Former Member
0 Kudos

How are you,
That's right, it is very strange that if you receive and move information for this structure but not do anything with that information.

Maybe missing a note applying to affect the corresponding tables. (VBPA3)

Thank you.
I appreciate your help and your contributions.

Former Member
0 Kudos

Hello,
Reviewed the BAPI and try to implement and do you know the outcome.
Thank you.

Former Member

Hello,

Unfortunately EX_VBPA3KOM is not used in BAPI.

However, just before the document is saved, at MV45AFZZ -> SAVE_DOCUMENT_PREPARE user exit you can reach that internal table and do necessarry update to XVBPA. Here is code that I've implemented. It resolves the problem. Note that, you need to keep providing BAPI EXTENSIONIN with VBPA3KOM

TYPES: tt_vbpa3kom TYPE TABLE OF vbpa3kom.
FIELD-SYMBOLS: <lt_vbpa3kom> TYPE tt_vbpa3kom,
<ls_vbpa3kom> TYPE vbpa3kom.
ASSIGN ('(SAPLVBAK)EX_VBPA3KOM[]') TO <lt_vbpa3kom>.
IF sy-subrc IS INITIAL.
LOOP AT xvbpa WHERE updkz EQ 'I'.
READ TABLE <lt_vbpa3kom> ASSIGNING <ls_vbpa3kom> WITH KEY vbeln = xvbpa-vbeln
posnr = xvbpa-posnr
parvw = xvbpa-parvw.
IF sy-subrc IS INITIAL.
MOVE-CORRESPONDING <ls_vbpa3kom> TO xvbpa.
ENDIF.
MODIFY xvbpa.
ENDLOOP.
ENDIF.

0 Kudos

I suspect OP has already found some solution for this question posted several months ago...

0 Kudos

Dear all,

aydin.kanat : Did try with your solution, however, I must mention that I only used the debugger and didn't modify the code so far. However, when I fill the EX_VBPA3KOM via BAPI EXTENSIONIN (checked in debugger) I get an empty table when evaluating SAPLVBAK)EX_VBPA3KOM[] in debugger. Does this only evaluate correctly when placing the code?

abel.luevano.perez : How did you solve your problem after all? Would you mind coming back and let us know?

Thanks and kind regards

J