‎2007 May 16 2:02 PM
hi experts,
if any one used this function module TSPAT_SINGLE_READ. Pls if you know pls explain with an example.
Rewards will be awarded.
Thanks.
‎2007 May 16 2:07 PM
Execute the function module and pass Language EN in TSPAT_SPRAS and give the Division name in TSPAT_SPART and execute the same. Then system will give you the Division text in EN language. Also you can get the same info from TSPAT Table.
Regards,
Param.
‎2007 May 16 2:06 PM
Hi Murugan,
TSPAT_SINGLE_READ : This function gives the Organizational Unit: Sales Divisions: Texts as output.
Regards,
Hemant
‎2007 May 16 2:08 PM
hi Hemant ,
i know it. When i try to execute it i got dump error. pls explain with an example.
‎2007 May 16 2:20 PM
Murugan,
I hope you are calling the FM inside the program (instead of executing it in SE37), if that is the case then you should take care of the exceptions or else you will end up with short dumps if you pass the language wrongly. you pass the langauge as sy-langu instead of passing EN or DE .
and uncomment the exceptions and remove the message statement which is there after if sy-subrc <> 0.
Regards
Vijay
‎2007 May 16 2:07 PM
Execute the function module and pass Language EN in TSPAT_SPRAS and give the Division name in TSPAT_SPART and execute the same. Then system will give you the Division text in EN language. Also you can get the same info from TSPAT Table.
Regards,
Param.
‎2007 May 16 2:09 PM
‎2007 May 16 2:12 PM
‎2007 May 16 2:24 PM
It is stored in the exporting parameter WTSPAT-VTEXT. WTSPAT is the structure.
Regrads
Vijay
‎2007 May 17 5:21 AM
HI VIJAY,
Thank u very much. I tried whatever u told. but still i got short dump error.
Pls find below my code.
&----
*& Report Z_TEST_FIED_DESC *
*& *
&----
*& *
*& *
&----
REPORT Z_TEST_FIED_DESC .
TABLES : MARA, MAKT.
DATA : BEGIN OF I_DATA OCCURS 0,
matnr LIKE mara-MATNR,
END OF I_DATA.
DATA : VTEXT LIKE MAKT-MAKTX.
SELECT matnr FROM mara INTO TABLE I_DATA.
LOOP AT I_DATA.
CALL FUNCTION 'MAKT_SINGLE_READ'
EXPORTING
KZRFB = ' '
MAXTZ = 0
MATNR = I_DATA-MATNR
SPRAS = SY-LANGU
IMPORTING
WMAKT-VTEXT = VTEXT.
EXCEPTION
WRONG_CALL = 1
NOT_FOUND = 2
OTHERS = 3.
.
IF SY-SUBRC <> 0.
ENDIF.
*
WRITE : / VTEXT.
ENDLOOP.
Pls help me to solve it.
‎2007 May 17 5:34 AM
Hi Murugan,
REPORT ZDEMOREPORT.
TABLES : MARA, MAKT.
DATA : BEGIN OF I_DATA OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF I_DATA.
<b>DATA : LS_WMAKT LIKE MAKT.</b>
SELECT MATNR FROM MARA INTO TABLE I_DATA.
LOOP AT I_DATA.
CALL FUNCTION 'MAKT_SINGLE_READ'
EXPORTING
KZRFB = ' '
MAXTZ = 0
MATNR = I_DATA-MATNR
SPRAS = SY-LANGU
IMPORTING
<b>WMAKT = LS_WMAKT</b>
EXCEPTIONS
WRONG_CALL = 1
NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
*
<b>WRITE : / LS_WMAKT-MAKTX .</b>
ENDLOOP.
you passed the parameters wrongly. check it as mentioned above
Regards
Vijay
‎2007 May 17 6:18 AM