on 01-21-2013 2:06 PM
Hello,
I have a requirement to print address from company code .
I know I have to input the ADRNR number from table T001 to ADDRNUMBER field of table ADRC and something to do with burks also .
What will be the code . it will be something like
ADDRESS PARAGRAPH AS
TITLE &ADRS-ANRED&
NAME &ADRS-NAME1&, &ADRS-NAME2&,
STREET &ADRS-STRAS&
POBOX &ADRS-PFACH& CODE &ADRS- PSTL2& CITY &ADRS-PFORT&
POSTCODE &ADRS-PSTLZ&
REGION &ADRS-REGIO&
CITY &ADRS-ORT01&, &ADRS-ORT02&
COUNTRY &ADRS-LAND1&
FROMCOUNTRY &ADRS-INLND&
ENDADDRESS
I am not sure what exactly it will be . can someone help me with the code.
I do not know how to pass these values in code form . Company code will come table t001w . here we take the ADRNR and pass the value to table ADRC and print address from this table .
Please put this in code form .
thanks
Mona
Hi Mona,
You just have to fetch the data into ADRC workarea and use WRITE_FORM funtion module for that window in which you have added this address command.
This by default call the FM ADDRESS_INTO_PRINTFORM and print the data in output. It will not print the words in CAPS i.e TITLE, NAME, STREET etc. It will just print the data in those variables.
Regards,
Mahidhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mona,
You cannot write the select query for fetching data into ADRC workarea in script form. You have to write it in driver program only or else use subroutines in sap script.
You dont have to call that FM seperately, by default ADDRESS and ENDADDRESS will call that function module.
You have to add the following code in sap script using command as "/:".
ADDRESS PARAGRAPH AS
TITLE &ADRS-ANRED&
NAME &ADRS-NAME1&, &ADRS-NAME2&,
STREET &ADRS-STRAS&
POBOX &ADRS-PFACH& CODE &ADRS- PSTL2& CITY &ADRS-PFORT&
POSTCODE &ADRS-PSTLZ&
REGION &ADRS-REGIO&
CITY &ADRS-ORT01&, &ADRS-ORT02&
COUNTRY &ADRS-LAND1&
FROMCOUNTRY &ADRS-INLND&
ENDADDRESS
Please let me know any issues.
Regards,
Mahidhar.
I have to print address in sapscript.
IF &EKKO-BUKRS& EQ &T001-BUKRS& is same
then pick the ADRNR number and validate with ADRC table and
IF &EKKO-ADRNR& EQ &ADRC-ADDRNUMBER&
&ADRC-NAME1&
&ADRC-STREET&
&ADRC-STR_SUPPL3&
&ADRC-CITY1& & ADRC-REGION& &ADRC-POST_CODE1&
How can I print company code specific address details.
I want to know the code that can be written in a sapscript editor
Advance thanks
I know I have to input the ADRNR number from table T001 to ADDRNUMBER field of table ADRC and something to do with burks also .
Hi Mona Lisa,
In your driver program please add the following code:
tables: t001, adrc.
select single adrnr
from t001
into (t001-adrnr)
where werks = p_plant.
if sy-subrc = 0.
select * from adrc
into adrs
where adrnr = t001-adrnr.
endif.
Use WRITE_FORM FM passing window name and element name of your sap script.
Now add the below code into sap script:
You have to add the following code in sap script using command as "/:".
ADDRESS PARAGRAPH AS
TITLE &ADRS-ANRED&
NAME &ADRS-NAME1&, &ADRS-NAME2&,
STREET &ADRS-STRAS&
POBOX &ADRS-PFACH& CODE &ADRS- PSTL2& CITY &ADRS-PFORT&
POSTCODE &ADRS-PSTLZ&
REGION &ADRS-REGIO&
CITY &ADRS-ORT01&, &ADRS-ORT02&
COUNTRY &ADRS-LAND1&
FROMCOUNTRY &ADRS-INLND&
ENDADDRESS
Hope it helps you.
Reward if helpful.
Mahidhar.
Hi Mona Lisa,
You cannot write select queries in SAP script. If you dont want to do it in driver program then you have to use subroutines. You can call subroutine of a custom program and write select queries inside that.
basic syntax for that would be like PERFORM subroutine IN programname.
Please refer for more info: http://wiki.sdn.sap.com/wiki/display/ABAP/Subroutines+And+Their+Use+In+SAPScript
Regards,
Mahidhar.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.