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: 

SAP Script : PO MEDRUCK - Delivery address not Printing

0 Kudos

Hi All..

I am facing problem in printing Delivery address without plant.

If i give manually in Plant (any Value) address printing correctly. I checked in CONSINEE window also there is no check fro Plant based.

In driver program also Prinitng Delivery address Plant is not  mandatory..

Please confirm me plant is mandatory  fro print delivery address , if not please let me how to handle this..

I have Value in the SDAR Structure as my required address...

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Prabu,

Please commnet all code  between Address and Endaddress and pass only Addressnumber  &SADR-ADRNR& only and check your ouput .

Note If your ADRC table having same address number with name and other details for Plant then value will be printing correclty.

Please try  this

/:ADDRESS DELIVERY PARAGRAPH AS

/:Addressnumber  &SADR-ADRNR&

/:ENDADDRESS

Regards,

Prasenjit

7 REPLIES 7

former_member202771
Contributor
0 Kudos

Hi Prabhu,

For Medruck program, we get address by passing plant to T001W table and getting adrnr.

Check for select query on T001W.

Thanks,

Anil

0 Kudos

Thanks Anil..

I have address Value in the Table(SADR). Even ADRNR also available. But my issue is in the WRITE_FORM not displaying the address with out plant. if i enter any value fro plant delivery address is printing with out any issue..  Can i enetr any dummy value for plane is that resanable solution... Please advice...

Thanks

Prabu

0 Kudos

Hi Prabhu,

The plant is not mandatory,

Include : LMEDRUCKF1R

Form    :  get_plant_address

here is where plant address is getting fetched from.

In Case we are customizing MEDRUK driver program,

we could get ADRNR value in following ways:

* Depending on storage type.

SELECT SINGLE * FROM twlad

     WHERE lgort EQ ekpo-lgort.

     IF sy-subrc EQ 0.

       MOVE twlad-adrnr TO st_addr1_sel_d-addrnumber.


* Depending on plant

SELECT SINGLE * FROM t001w

           WHERE werks EQ i_ekpo-werks.

           MOVE t001w-adrnr TO st_addr1_sel_d-addrnumber.


*Based on venodr

SELECT SINGLE name1 adrnr

           FROM lfa1

           INTO (v_name1, v_adrnr)

          WHERE lifnr EQ v_lifn2.


MOVE v_adrnr TO st_addr1_sel_a-addrnumber.


*Based on company code

SELECT SINGLE * FROM t001

             WHERE bukrs EQ ekko-bukrs.

     MOVE t001-adrnr TO st_addr1_sel_a-addrnumber.


After this, pass st_addr1_sel_a-addrnumber to CALL FUNCTION 'ADDR_GET'.


Thanks,

Anil

0 Kudos

Thanks..

I have fetched values based on Kunnr... I have address value but problem is not priting .. Structure all value avilable.

    IF pekko-werks NE space OR
     pekko-kunnr NE space OR
     pekko-adrn2 NE space OR
     pekko-emlif NE space OR
     pekko-adrnr NE space.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        element = 'HEADER_DELADDRESS'
        window  = 'CONSGNEE'
      EXCEPTIONS
        OTHERS  = 01.
    CLEAR sy-subrc.
  ENDIF.

Above place have problem ..  if i pass any value for pekko-werks works fine.. but my case i have value for adrnr and Kunnr.

0 Kudos

Hi Prabhu,

WRITE_FORM failing,

even after we have values of    pekko-kunnr and pekko-adrnr.?

thanks,

Anil

0 Kudos

Hi Anil..

Thanks..

Now in my adress not prinitnig complete address.

PO BO and fine REGIOn and LAND one not prinitnig ..

Please find the below syntex and let me know any  of this below is wrong.

ADDRESS DELIVERY PARAGRAPH AS

  TITLE    &SADR-ANRED&

  NAME     &SADR-NAME1&, &SADR-NAME2&, &SADR-NAME3&, &SADR-NAME4&

  STREET   &SADR-STRAS&

  POBOX    &SADR-PFACH&  CODE &SADR-PSTL2&  CITY &SADR-PFORT&

  CITY     &SADR-ORT01&, &SADR-ORT02&

  POSTCODE &SADR-PSTLZ&

  COUNTRY  &SADR-LAND1&

  REGION   &SADR-REGIO&

  FROMCOUNTRY &LFA1-LAND1&

ENDADDRESS

Former Member
0 Kudos

Hi Prabu,

Please commnet all code  between Address and Endaddress and pass only Addressnumber  &SADR-ADRNR& only and check your ouput .

Note If your ADRC table having same address number with name and other details for Plant then value will be printing correclty.

Please try  this

/:ADDRESS DELIVERY PARAGRAPH AS

/:Addressnumber  &SADR-ADRNR&

/:ENDADDRESS

Regards,

Prasenjit