Application Development and Automation 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: 
Read only

function module

Former Member
0 Likes
874

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
836

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.

10 REPLIES 10
Read only

Former Member
0 Likes
836

Hi Murugan,

TSPAT_SINGLE_READ : This function gives the Organizational Unit: Sales Divisions: Texts as output.

Regards,

Hemant

Read only

0 Likes
836

hi Hemant ,

i know it. When i try to execute it i got dump error. pls explain with an example.

Read only

0 Likes
836

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

Read only

Former Member
0 Likes
838

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.

Read only

0 Likes
836

in which variable the description will be stored ?

Read only

0 Likes
836

WTSPAT

Read only

0 Likes
836

It is stored in the exporting parameter WTSPAT-VTEXT. WTSPAT is the structure.

Regrads

Vijay

Read only

0 Likes
836

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.

Read only

0 Likes
836

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

Read only

0 Likes
836

thanks vijay. I got it. Thanks a lot.