on 03-31-2008 5:09 AM
Hi all.
Can we link two tables in SAPscript like in abap coding?
I have a code from other table and I need to pull the txt of the code from its master table.
Is it possible to do this?
Thanks in advance.
Regards
az
Hi,
Yes you can.You need to code either in driver program of use a perform to call your own program in scripts. Use FM READ_TEXT to get the text if you want.
Reward if helpful.
Thanks,
Dishant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are creating your own Z program. use like this:
Check below,
In the script window where you want to put the text write:
PERFORM get_address in program ZPR(ie your prog name) USING &var1&
CHANGING &var2&.
Now in your Z program.
FORM get_address TABLES pt_input STRUCTURE itcsy
pt_output STRUCTURE itcsy.
TABLES: ekko,t880,t024.
TYPES: BEGIN OF structadd,
name1 LIKE t880-name1,
stret LIKE t880-stret,
city LIKE t880-city,
cntry LIKE t880-cntry,
pstlc LIKE t880-pstlc,
END OF structadd.
DATA: address TYPE structadd,
ponumber LIKE ekko-ebeln,
countryname LIKE t005t-landx,
companycode LIKE t880-rcomp.
READ TABLE pt_input INDEX 1.
IF sy-subrc = 0.
ponumber = pt_input-value.
ENDIF.
SELECT SINGLE bukrs FROM ekko
INTO companycode WHERE ebeln = ponumber.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = companycode
IMPORTING
output = companycode.
SELECT SINGLE name1 stret city cntry pstlc FROM t880
INTO address WHERE rcomp = companycode.
SELECT SINGLE landx FROM t005t INTO countryname
WHERE land1 = address-cntry AND spras = 'EN'.
READ TABLE pt_output WITH KEY name = 'NAME1'.
pt_output-value = address-name1.
MODIFY pt_output TRANSPORTING value WHERE name = 'NAME1'.
READ TABLE pt_output WITH KEY name = 'STRET'.
pt_output-value = address-stret.
MODIFY pt_output TRANSPORTING value WHERE name = 'STRET'.
READ TABLE pt_output WITH KEY name = 'CITY'.
pt_output-value = address-city.
MODIFY pt_output TRANSPORTING value WHERE name = 'CITY'.
READ TABLE pt_output WITH KEY name = 'CNTRY'.
pt_output-value = countryname.
MODIFY pt_output TRANSPORTING value WHERE name = 'CNTRY'.
READ TABLE pt_output WITH KEY name = 'PSTLC'.
pt_output-value = address-pstlc.
MODIFY pt_output TRANSPORTING value WHERE name = 'PSTLC'.
ENDFORM. "get_address
Reward if helpful.
Thanks,
Dishant
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.