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

BAPI _ SALESDOCU _ CREATEFROMDATA1 - Addresses

Former Member
0 Likes
673

Hi

I'm trying to use this BAPI. I have addresses entered in the table record including and address number for the partners. However I still get the following error message : "Specify either address number or address handle"

Any ideas ? I'm stuck !

Cheers

Alistair

Hi

I'm trying to use this BAPI. I have addresses entered in the table record including and address number for the partners. However I still get the following error message : "Specify either address number or address handle"

Any ideas ? I'm stuck !

Cheers

Alistair

2 REPLIES 2
Read only

Former Member
0 Likes
444

Hi Alistair,

Use "ADDR_LINK" field of the BAPIPARNR structure and "ADDR_NO" field of the Partner Addresses structure. Here is the sample code:

Here, I want to change the Ship to address during the creation of the order, so initially filling the BAPIPARNR with some field values:

'WE'  TO wa_partners-partn_role,
  '115' TO wa_partners-partn_numb,
  '1'          to wa_partners-addr_link.   (You need to use this address link for Address no in Partner addresses)
APPEND wa_partners TO t_partners.


MOVE:
  '1'        to wa_partneraddresses-addr_no,
*  'Mr.'      to wa_partneraddresses-title,
  'MAH QA POST TEST 6'      to wa_partneraddresses-name,
  'TEMPE'    to wa_partneraddresses-city,
  'AZ'       to wa_partneraddresses-region,
  '81190'    to wa_partneraddresses-postl_cod1,
  '8123 S. HARDY' to wa_partneraddresses-street,
  'US'       to wa_partneraddresses-country,
  'APT 2004'   to wa_partneraddresses-str_suppl1,
  '1111122222' to wa_partneraddresses-tel1_numbr.
APPEND wa_partneraddresses to t_partneraddresses.

This will solve your problem.

Regards,

Adithya K

[email protected]

P.S: Reward points if the solution is useful

Read only

Former Member
0 Likes
444

Cheers for the reply. Unfortunately I don't think your answer applies to BAPI _ SALESDOCU _ CREATEFROMDATA1 as it has no address structure. I think your solution replies to BAPI_SALESORDER_CREATEFROMDAT2. But thanks for the suggestion anyway.

Cheers

Alistair

P.S. I need to use the sales doc bapi rather than the sales order bapi as I'm created a sales document type 'L' rather than type 'C'.