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

error in report

Former Member
0 Likes
929

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
892

hi,

send the partner role as AG instead of SP.

regards,

Ravi

7 REPLIES 7
Read only

Former Member
0 Likes
892

Hi Giri,

Try to send the partner number with leading zeroes.

Regards,

Ravi

Read only

0 Likes
892

Ravi,

then also same error:

E |VP |112 |Please enter sold-to party or ship-to party

Giri

Read only

naimesh_patel
Active Contributor
0 Likes
892

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

Read only

0 Likes
892

still same problem

in error message the parameters variable has "SALES_HEADER_IN" for that error

Read only

Former Member
0 Likes
893

hi,

send the partner role as AG instead of SP.

regards,

Ravi

Read only

0 Likes
892

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

Read only

0 Likes
892

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