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 entering values

Former Member
0 Kudos
1,271

Hi,

I am thinking of using the function module SD_SALESDOCUMENT_CREATE to create credit memo request. I am getting the error saying 'Please Enter sold to party or ship to party'. Where should I enter it.

I created the credit memo request using VA01 and entered the following values.

ordtype-ZMKD

salesorg

distChan

Div

Soldtoparty

Ponum

Matnr

TargetQty

Ord Reason

Ref Doc No

Header -> Texts

Item -> Shipping -> Plant

Item -> Conditions ZCPP -> Price

And tried to enter the same values in the SD_SALESDOCUMENT_CREATE, but could not find some of those,

ordtype-ZMKD - yes - sales_header_in

salesorg - yes - sales_header_in

distChan - yes - sales_header_in

Div - yes - sales_header_in

Soldtoparty - no

Ponum - yes - sales_header_in - purch_no_c

Matnr -yes - sales_items_in

TargetQty -yes - sales_items_in

Ord Reason - no

Ref Doc No - no

Header -> Texts - no

Item -> Shipping -> Plant - no

Item -> Conditions ZCPP -> Price - no

Please help me where to enter the remaining fields and also Sold to Party.

Thank you,

Neelu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
205

HI,

You have to pass the sold to and ship to in the parameter SALES_PARTNERS..

You can also use the BAPI 'BAPI_SALESDOCU_CREATEFROMDATA1'

CHeck this link for a sample code

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-Simpleprogramtocreatesalesorderusing+BAPI

Thanks

Naren

9 REPLIES 9

Former Member
0 Kudos
206

HI,

You have to pass the sold to and ship to in the parameter SALES_PARTNERS..

You can also use the BAPI 'BAPI_SALESDOCU_CREATEFROMDATA1'

CHeck this link for a sample code

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-Simpleprogramtocreatesalesorderusing+BAPI

Thanks

Naren

0 Kudos
205

Hi Naren,

I entered the sold to party 1014 in the sales_partners PARTN_NUMB, but I got the same error saying ‘please enter sold to or ship to party’. Should I enter any value in the PARTN_ROLE AND ITM_NUMBER.

I got notes that 'BAPI_SALESDOCU_CREATEFROMDATA2' will not work for creating Credit Memo Request.

I tried the BAPI 'BAPI_SALESDOCU_CREATEFROMDATA2' and got the error as "Unpermitted combination of business object BUS2032 and sales doc. category K".

Are 'BAPI_SALESDOCU_CREATEFROMDATA1' and 'BAPI_SALESDOCU_CREATEFROMDATA1' are same or different.

Thanks,

Neelu.

0 Kudos
205

Hello Neelu,

You need to mention Partner role otherwise it will give error.

I don't think item number is required.

just use

sold to party

ship to party

partner role -> role will be WE is ship to party,ag is sold to party

append partner itab.

Thanks

Seshu

0 Kudos
205

Hi,

Now It said the sales document has been saved, and also it said sales document is not yet completed: edit data. Message_V1 - VBAPKOM, Parameter – VBUVKOM.

I went to VA03 to check the document it is not there.

Please help me to fix this.

Thanks,

Neelu.

Message was edited by:

neelu reddy

0 Kudos
205

Hello Neelu,

Please call BAPI_TRANSACTION_COMITT after SD_SALESDOCUMENT_CREATE.

It should be data problem,when you pass data to FM ,suppose material number is 100,you need to pass like 0000000000000000100(should be 18 char),same to item number.

qty field - you need to pass scheduline line structure.

Partner should be like suppose 1200,it should be 0000001200

Thanks

Seshu

0 Kudos
205

Hi Seshu,

To call BAPI_TRANSACTION_COMITT, do I have to go to Function Modules -> Other Function Module.

Please let me know.

Regards,

Neelu.

0 Kudos
205

Just see the below code :

data : i_ret2 like bapiret2 .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = space

IMPORTING

RETURN = i_ret2.

or you can call like

in se38 -> click on pattern -> enter FM and enter-> it will place in editor.

make sure that keep the cursor after FM SD_SALESDOCUMENT_CREATE

Thanks

Seshu

0 Kudos
205

I do not see pattern in SE38 or SE37.

Thanks,

Neelu.

Clemenss
Active Contributor
0 Kudos
205

we had this question 1 or 2 days ago in this very forum. Do a search on SD_SALESDOCUMENT_CREATE and credit memo and find more than I said.

Regards,

Clemens