Skip to Content
author's profile photo Former Member
Former Member

Include object text id in script

Hi friends,

I'm using an include statement in script as follows,

/: INCLUDE &OBJNAME& OBJECT 'VTTK' ID 'Z012' PARAGRAPH IT

which returns booking number in shipment text.

How can I store the text returned by the statement in another temp variable in , so that I can display that in a diff place in SAP script place.

For eg :

I have the following statment paragraph format T1

T1 &VTTK-TKNUM&,, ,, &TEXT&

I want to display the text returned by the Include statement above in between

&VTTK-TKNUM& and &TEXT&

Thanks & Regards,

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 03:48 PM

    Hi,

    you can use in this way ..

    /: &VTTK-TKNUM&,,

    = INCLUDE &OBJNAME& OBJECT 'VTTK' ID 'Z012' PARAGRAPH IT

    = &TEXT&

    So that it will come in same line

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 03:49 PM

    use this function module to store the same include value in a text variable

    gt_inlines type tline.

    gt_lines type tline.

    call function 'READ_TEXT_INLINE'

    EXPORTING

    id = 'Z012'

    inline_count = 1

    language = 'EN'

    name = OBJNAME

    object = 'VTTK'

    TABLES

    inlines = gt_inlines

    lines = gt_lines

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    not_found = 4

    object = 5

    reference_check = 6.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 03:51 PM

    Hi Hari,

    Use the Read_Text function module.

    write a subroutine in a program and call this subroutine in the Script..

    Syntax goes like this

    /: PERFORM <form> IN PROGRAM <prog>

    /: USING &INVAR1&

    /: USING &INVAR2&

    ......

    /: CHANGING &OUTVAR1&

    /: CHANGING &OUTVAR2&

    ......

    /: ENDPERFORM

    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

    Example:

    In script form

    /: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'

    /: USING &EKKO-EKORG&

    /: USING &EKPO-WERKS&

    /: USING &EKKO-EKGRP&

    /: USING &EKKO-BSTYP&

    /: CHANGING &COMPNAME&

    /: CHANGING &SENDADR&

    /: CHANGING &INVCADR&

    /: CHANGING &COMPADR&

    /: CHANGING &COVERLTR&

    /: CHANGING &SHIPADR&

    /: CHANGING &REMINDER&

    /: CHANGING &REJECTION&

    /: CHANGING &POSTADR&

    /: CHANGING &LOGO&

    /: ENDPERFORM

    In program

    ----


    • FORM Read_texts - To extract the standard texts from the table *

    ----


    FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY

    OUT_PAR STRUCTURE ITCSY.

    DATA : L_EKORG TYPE EKORG,

    L_WERKS TYPE WERKS_D,

    L_BSTYP TYPE BSTYP,

    L_EKGRP TYPE BKGRP.

    READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .

    CHECK SY-SUBRC = 0.

    L_EKORG = IN_PAR-VALUE.

    READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .

    CHECK SY-SUBRC = 0.

    L_WERKS = IN_PAR-VALUE.

    READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .

    CHECK SY-SUBRC = 0.

    L_EKGRP = IN_PAR-VALUE.

    READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .

    CHECK SY-SUBRC = 0.

    L_BSTYP = IN_PAR-VALUE.

    CLEAR Z08M1_ORG_TEXTS.

    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG

    AND WERKS = L_WERKS

    AND EKGRP = L_EKGRP

    AND BSTYP = L_BSTYP.

    IF SY-SUBRC NE 0.

    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG

    AND WERKS = L_WERKS

    AND EKGRP = L_EKGRP

    AND BSTYP = SPACE.

    ENDIF.

    READ TABLE OUT_PAR WITH KEY 'COMPNAME'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'SENDADR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'INVCADR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'COMPADR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'COVERLTR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'SHIPADR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'REMINDER'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'REJECTION'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'POSTADR'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.

    MODIFY OUT_PAR INDEX SY-TABIX.

    READ TABLE OUT_PAR WITH KEY 'LOGO'.

    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.

    MODIFY OUT_PAR INDEX SY-TABIX.

    ENDFORM.

    Thaks

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.