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: 

purchase requisition report

Former Member
0 Kudos

hi

i am making purchase requisition report in which i want a header text

i am using funtion module read_text to fatch the data but i am not getting it

my code is:

FORM call_txt .

data: fs_readhead type THEAD,

fs_line type table of TLINE with header line,

wf_mandt type sy-mandt,

wf_lang type THEAD-TDSPRAS,

wf_id type THEAD-TDID.

wf_mandt = sy-mandt.

wf_lang = sy-langu.

wf_id = 'B01'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = wf_mandt

id = wf_id

language = wf_lang

name = '0015000151'

object = 'EBANH'

ARCHIVE_HANDLE = 0

IMPORTING

HEADER = fs_readhead

tables

lines = fs_line

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT fs_line

.

IF NOT fs_line-tdline IS INITIAL.

CONCATENATE fs_readhead fs_line-tdline INTO fs_readhead SEPARATED BY space.

ENDIF.

ENDLOOP.

WRITE: fs_readhead .

ENDFORM. " call_txt

can any one tell me the suitable answer .

its urgent

regards

Rakesh kumar singh

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

instead of passing directly pass it to the variable and see..

w_tdname = '0015000151'.
w_object = 'EBANH'.
 

 CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id                      = w_tdid
      language                = w_spras
      name                    = w_tdname
      object                  = w_object
    TABLES
      lines                   = it_line
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
  IF sy-subrc EQ 0.

endif.

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

instead of passing directly pass it to the variable and see..

w_tdname = '0015000151'.
w_object = 'EBANH'.
 

 CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id                      = w_tdid
      language                = w_spras
      name                    = w_tdname
      object                  = w_object
    TABLES
      lines                   = it_line
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
  IF sy-subrc EQ 0.

endif.

0 Kudos

thanks for your replay

i have give the variable but the same result .

0 Kudos

wf_id = 'B01'. is the correct one.

what is the sy-subrc value of the function. and is there a long text maintained for that PR.

Check it once. And what parameters you are passing should exactly match. Go to Long text editor in the Trasnaction , from menu Click on Header and see the properties.

0 Kudos

code which i have changed is like that .

FORM call_txt .

data: fs_readhead type THEAD,

fs_line type table of TLINE with header line,

wf_mandt type sy-mandt,

wf_lang type THEAD-TDSPRAS,

wf_id type THEAD-TDID.

data :

w_tdname type tdobname ,

w_object type tdobject .

wf_mandt = sy-mandt.

wf_lang = sy-langu.

wf_id = 'B01'.

w_tdname = '0015000151'.

w_object = 'EBANH'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

*CLIENT = wf_mandt

id = wf_id

language = wf_lang

name = w_tdname

object = w_object

*ARCHIVE_HANDLE = 0

*IMPORTING

*HEADER = fs_readhead

tables

lines = fs_line

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT fs_line

.

IF NOT fs_line-tdline IS INITIAL.

CONCATENATE fs_readhead fs_line-tdline INTO fs_readhead SEPARATED BY space.

ENDIF.

ENDLOOP.

WRITE: fs_readhead .

result which i am getting is

00000 00000000000000 0000000000000000000000 0 FOR CCM USE

i want to remove 0000 s only i want text FOR CCM USE

Edited by: RAKESH KUMAR SINGH on Jul 26, 2008 8:24 AM

0 Kudos

it gives what you enter the text. but if you want to do you can use REPLACE

You use REPLCE '0'

loop at it_text.

REPLACE ALL OCCURENCES of '0' in ltext-line with ''.

condense text-line with no-gaps.

endloop.

and see.