‎2008 Jun 10 5:07 PM
hi,
why this code is not working?
I am getting error message in return table like Please enter Sold to party or ship to party.
Data: zinq_head like BAPISDHD1 occurs 0 with header line,
zbapiret like bapiret2 occurs 0 with header line,
zinq_partner like BAPIPARNR occurs 0 with header line.
zinq_head-DOC_TYPE = 'ZIN'.
zinq_head-SALES_ORG = 'SD01'.
zinq_head-DISTR_CHAN = '01'.
zinq_head-DIVISION = '01'.
append zinq_head.
zinq_partner-PARTN_ROLE = 'SP'.
zinq_partner-PARTN_NUMB = '22'.
append zinq_partner.
CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'
EXPORTING
* SALESDOCUMENTIN =
INQUIRY_HEADER_IN = ZINQ_HEAD
* INQUIRY_HEADER_INX =
* SENDER =
* BINARY_RELATIONSHIPTYPE =
* INT_NUMBER_ASSIGNMENT =
* BEHAVE_WHEN_ERROR =
* LOGIC_SWITCH =
* TESTRUN =
* CONVERT = ' '
* IMPORTING
* SALESDOCUMENT =
TABLES
RETURN = ZBAPIRET
INQUIRY_PARTNERS = zinq_partner
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
write: 'Successfully updated'.when i provide same values with se37 tcode in BAPI then its working fine.
i believe i am missing any conversion exits or any other field to provide in bapi.
Giri
‎2008 Jun 10 5:23 PM
‎2008 Jun 10 5:09 PM
Hi Giri,
Try to send the partner number with leading zeroes.
Regards,
Ravi
‎2008 Jun 10 5:12 PM
Ravi,
then also same error:
E |VP |112 |Please enter sold-to party or ship-to party
Giri
‎2008 Jun 10 5:15 PM
It looks like your partner number 0000000022 and you are trying to pass zinq_partner-PARTN_NUMB = '22'.
Pad leading zeros to that field and than pass to the BAPI.
Use the FM CONVERSION_EXIT_ALPHA_INPUT to get the partner number in the internal format (in this case, with leading zero).
Regards,
Naimesh Patel
‎2008 Jun 10 5:22 PM
still same problem
in error message the parameters variable has "SALES_HEADER_IN" for that error
‎2008 Jun 10 5:23 PM
‎2008 Jun 10 5:26 PM
Ravi,
with AG it is working fine.
why not with SP sold to party for the customer?
please explain this, What is difference between AG and SP so i can close the thread......
Giri
‎2008 Jun 11 5:45 PM
Hi,
There is something called internal and external format for some fields in SAP.
For the Partner Function Field,
the external representation for sold to party is SP and Internally it is stored as AG.
Similarly for ship to party External representation is SH and internally it is WE.
When you ran it in the SE37 the system took care of the conversion from external to internal.
But when you write your program, you have to explicitly pass 'AG' for sold to party.
If you want to see the effect for yourself,
you can convert the Partner function from external to internal format and vice versa, you can use the following FMs:
CONVERSION_EXIT_PARVW_INPUT
CONVERSION_EXIT_PARVW_OUTPUT
Regards,
Ravi Kanth Talagana