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

READ_TEXT

Former Member
0 Likes
814

hi

i want to use FM read_text in which i have to send

vbak-vbeln and vbap-posnr in parameter name but i forget the how to combine order number and item number to pass them to parameter 'NAME'. could you please suggest.

Regards

Aditya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
784

This will do

concatenate vbak-vbeln vbap-posnr into name.

condense name.

tnx.

8 REPLIES 8
Read only

Former Member
0 Likes
784

Hi,

Open the sales order, display the text in Script Editor, check the header details there. It will give you the name and the other parameters.

Read only

0 Likes
784

How to dsplay text in sapscript environment???

Aditya

Read only

0 Likes
784

See this FM used in a short example program below:


DATA: BEGIN OF tbl_lines OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA: END OF tbl_lines.

DATA: l_name LIKE thead-tdname.

PARAMETERS pa_vbeln LIKE vbak-vbeln.

START-OF-SELECTION.

  l_name = pa_vbeln.

  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = '0001'  "<----Header text
      language                = sy-langu
      name                    = l_name
      object                  = 'VBBK'
    TABLES
      lines                   = tbl_lines
    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.

    LOOP AT tbl_lines.
      WRITE tbl_lines-tdline.
    ENDLOOP.

  ELSE.
    WRITE:/ 'Sy-Subrc = ', sy-subrc.
  ENDIF.

After getting the header text, use FM Write_Form to write it out in a SapScript. For item text use same FM READ_TEXT but object will be 'VBBP'. You can't get all the texts of the sales order at the same time - you'll have to call this function separately for header text and item text and pass the ID correctly. Please read the function module documentation which clearly states Generic entries in these parameters are not valid.

Hope this helps and please don't forget to reward points.

Cheers,

Sougata.

Read only

0 Likes
784

hi

i need to know how to concatenate vbaln and posnr to pass it to name parameter

Aditya

Read only

0 Likes
784

Changing the example program in my last post.


PARAMETERS: pa_vbeln LIKE vbak-vbeln,
            pa_posnr LIKE vbap-posnr.

START-OF-SELECTION.

  CONCATENATE pa_vbeln pa_posnr INTO l_name.

  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = '0001'          "Item text
      language                = sy-langu
      name                    = l_name
      object                  = 'VBBP'
    TABLES
      lines                   = tbl_lines
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.

Please don't forget to reward points

Cheers,

Sougata.

Read only

Former Member
0 Likes
785

This will do

concatenate vbak-vbeln vbap-posnr into name.

condense name.

tnx.

Read only

Former Member
0 Likes
784

thanks to all

Read only

0 Likes
784

Aditya,

We worked hard to solve your problem - you reward us with

just 2 points each and close the thread??!! That is very unfair

and annoying indeed.

Cheers,

Sougata.