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 standard Script Debug Problem

Former Member
0 Kudos

hi friends

iam doing a standard script debugging of P.O.

ME23N --when i print for particular p.o instead of delivery adress

i get mold shop adress in my print preview ..i trying to debug the program

zm06pf04.... which has follwoing code and i didnt get what the function is returining

in the following code .

i will be thankfull if anybody advice me

regards

farukh

FORM WERKSANSCHRIFT_WH1 USING WAN_WERKS. "CETJF1 05/22/00

DATA: ADDRESS_SELECTION LIKE ADDR1_SEL. "aem110801

CLEAR SADR.

CHECK WAN_WERKS NE SPACE.

SELECT SINGLE * FROM T001W WHERE WERKS EQ WAN_WERKS.

CHECK SY-SUBRC EQ 0.

CLEAR SADR.

IF T001W-ADRNR NE SPACE.

ADDRESS_SELECTION-ADDRNUMBER = T001W-ADRNR. "aem110801

CALL FUNCTION 'ADDR_GET' "aem110801

EXPORTING "aem110801

ADDRESS_SELECTION = ADDRESS_SELECTION "aem110801

IMPORTING "aem110801

SADR = SADR "aem110801

EXCEPTIONS "aem110801

OTHERS = 1. "aem110801

Endif. "aem110801

if sy-subrc <> 0 or "aem110801

t001w-adrnr is initial. "aem110801

SADR-NAME1 = T001W-NAME1.

SADR-NAME2 = T001W-NAME2.

SADR-STRAS = T001W-STRAS.

SADR-PFACH = T001W-PFACH.

SADR-PSTLZ = T001W-PSTLZ.

SADR-ORT01 = T001W-ORT01.

SADR-LAND1 = T001W-LAND1.

SADR-REGIO = T001W-REGIO.

ENDIF.

  • pur grps L18 L19 L20 get Mold Shop address using function "aem110801

IF EKKO-EKGRP = 'L18' "CETJF1 05/22/00

OR EKKO-EKGRP = 'L19' "CETJF1 05/22/00

OR EKKO-EKGRP = 'L20'. "CETJF1 05/22/00

  • **** start of change **** "aem110801

refresh: addr_srch, addr_grps, srch_found.

clear: addr_grps, addr_srch, srch_found.

move 'ME01' to addr_grps-addr_group.

append addr_grps.

move 'NEW MOLD SHOP' to addr_srch-sort1.

clear addr_srch-sort2.

append addr_srch.

CALL FUNCTION 'ADDR_SEARCH'

EXPORTING

SEARCH_FOR = addr_srch

UP_TO_ROWS = 1

IMPORTING

ADDRESSES_FOUND_COUNT = addr_cnt

RETURNCODE = returncode

TABLES

ADDRESS_GROUPS = addr_grps

SEARCH_RESULT = srch_found

EXCEPTIONS

PARAMETER_ERROR = 1

INTERNAL_ERROR = 2

OTHERS = 3.

if sy-subrc = 0.

clear sadr.

read table srch_found index 1.

sadr-ANRED = srch_found-TITLE.

sadr-name1 = srch_found-name1.

sadr-name2 = srch_found-name2.

sadr-STRAS = srch_found-STREET.

sadr-ORT01 = srch_found-CITY1.

sadr-PSTLZ = srch_found-POST_CODE1.

sadr-LAND1 = srch_found-COUNTRY.

sadr-REGIO = srch_found-REGION.

sadr-TELF1 = srch_found-TEL_NUMBER.

sadr-TELFX = srch_found-FAX_NUMBER.

endif.

endif.

endform

4 REPLIES 4

Former Member
0 Kudos

Hi,

Really i dont get it your problem. Plz explain in details

with Regards,

Neptune.M

0 Kudos

when i (print) or run me23n tcode for a prticular p.o

instead of ship to adress or delivery adress iam getting the differnt adress.

Former Member
0 Kudos

This is my suggestion.

In the debug mode u r getting the Address number.right?

In SE37,

pass this Address number to the FM "<b>SD_ADDRESS_GET</b>"

u get the Address detail. Compare the results.

May be it will helpful.

- Selvapandian Arunachalam

Former Member
0 Kudos

Hi Farukh,

This is asample code for SD_ADDR_GET:

CALL FUNCTION 'SD_ADDRESS_GET'

EXPORTING

FIF_ADDRESS_NUMBER = TVKO-ADRNR "Address number

  • FIF_PERSONAL_NUMBER =

  • FIF_ADDRESS_TYPE =

IMPORTING

FES_ADDRESS = LVS_VBADR_EXP

EXCEPTIONS

ADDRESS_NOT_FOUND = 1

ADDRESS_TYPE_NOT_EXISTS = 2

NO_PERSON_NUMBER = 3

OTHERS = 4.