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

scripts

hi help me in this issue,

i need to devolop a script for that i need a sample printi program as a reference, can anyone send me the sample code for scripts.

thanks & Regards

kiran kumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 02:33 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2006 at 02:35 PM

    Hi kiran,

    Regarding SAPScripts this might help you

    -


    http://help.sap.com/saphelp_40b/helpdata/en/d6/0dc169494511d182b70000e829fbfe/applet.htm

    Regards

    pavan

    if helpfull Reward Points

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 02:49 PM

    Hi Kiran,

    You better refere any st print program

    regs

    rams

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2006 at 08:10 PM

    it is not simle and universal code!!!

    each program have diferent fields to display!!!

    post yuor abap code,and somebody should help.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 04:09 AM

    Hi,

    Check the following example print programs...

    1)RSTXEXP1 --SAPscript: Sample Program for Form Printing

    2)RSTXEXP2 --SAPscript: Example program for Course CA930 Chapter 5

    3)RSTXEXP3 --Template report for practice task, exercise chapter 5, course CA93

    Thanks and Regards,

    Bharat Kumar Reddy.V

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 04:13 AM

    I devloped script with my own print program,check this and let me know if u face any problem.

    *----


    *

    • Author : Vasanth.M,Ravindranath.K *

    • Department : CI/ISY2 *

    • SAP - USER (Author) : KNR1KOR *

    • Short Description : Stamp Printing by SAPscript *

    *----


    *

    REPORT z08v3_prt_befa .

    INCLUDE rvadtabl.

    INCLUDE z08v3_prt_befa_top. "Data Declaration

    DATA: g_f_trans(132).

    DATA: retcode LIKE sy-subrc, "Returncode

    xscreen(1) TYPE c. "Ausgabe Printer/Screen

    DATA:gs_kna1 LIKE kna1.

    DATA:iegland LIKE t005.

    DATA:p_flag TYPE c.

    DATA:p_flag1 TYPE c.

    DATA:p_flag2 TYPE c.

    DATA:g_flag TYPE c.

    DATA:z_text LIKE z08v3_transtextt.

    *DATA:n TYPE p DECIMALS 2.

    DATA:weight TYPE p DECIMALS 2.

    DATA:inco1 TYPE likp-inco1.

    DATA:volume TYPE p DECIMALS 2.

    DATA:f_char(3) TYPE c.

    DATA:f_char1(9) TYPE c VALUE 'FRANKATUR'.

    *&----


    *

    *& Form ENTRY

    *&----


    *

    • text

    *----


    *

    • -->RETURN_CODE text

    • -->US_SCREEN text

    *----


    *

    FORM entry USING return_code us_screen.

    CLEAR retcode.

    xscreen = us_screen.

    PERFORM processing USING xscreen.

    IF retcode NE 0.

    return_code = 1.

    ELSE.

    return_code = 0.

    ENDIF.

    ENDFORM. "ENTRY

    *----


    *

    • FORM PROCESSING - Main Routine

    *----


    *

    • Aufruf Unterprogramme

    FORM processing USING proc_screen.

    • Clear all the global variables,structures and tables.

    CLEAR: shipment_number,

    vttkvb,

    tvtk,

    tvtkt,

    ttds,

    ttdst,

    vbpla,

    xvttp,

    slk,

    slp,

    xvtts,

    xvtsp,

    xvbpa,

    xvbadr,

    xvtfa,

    xvbplk,

    xvbplp,

    xvbpls,

    gs_befa,

    gs_likp,

    gs_tvstt,

    gs_tvrab,

    gs_t173t,

    g_f_var1,

    g_f_var2,

    g_f_var3,

    g_f_var4,

    g_f_var5,

    g_f_var6,

    g_f_var7,

    g_f_var8,

    g_f_var9,

    g_f_var10,

    g_f_var11,

    g_f_var12,

    g_f_var13,

    g_f_var14,

    g_f_var15,

    g_f_text1,

    g_f_text2,

    g_f_text3,

    g_f_text4,

    g_f_text5,

    g_f_text6,

    g_f_text7,

    g_f_text8,

    g_t_lines,

    p_flag,

    weight,

    f_char,

    z_text.

    • Refresh the globally defined tables.

    REFRESH: xvttp,

    slk,

    slp,

    xvtts,

    xvtsp,

    xvbpa,

    xvbadr,

    xvtfa,

    xvbplk,

    xvbplp,

    xvbpls,

    g_t_lines.

    • Datenbeschaffung über Funktionsbaustein

    PERFORM get_data.

    • Füllen Sapscript-Formular mit Daten

    PERFORM item_print_text.

    PERFORM get_type_text.

    • Öffnen des Sapscript-Formulars für Packstücketikette

    PERFORM form_open USING proc_screen xvbadr-land1.

    PERFORM write_add.

    PERFORM control_form.

    • PERFORM END_FORM.

    PERFORM form_close.

    ENDFORM. "PROCESSING

    *&----


    *

    *& Form GET_DATA

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM get_data.

    */ To get the shipment header data

    PERFORM ship_data.

    ENDFORM. " GET_DATA

    *&----


    *

    *& Form FORM_OPEN

    *&----


    *

    • text

    *----


    *

    • -->P_PROC_SCREEN text

    *----


    *

    FORM form_open USING us_screen us_country.

    • INCLUDE Z08V3_PRT_BEFA_RVADOPFO.

    INCLUDE rvadopfo.

    ENDFORM. " FORM_OPEN

    *&----


    *

    *& Form FORM_CLOSE

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM form_close.

    CALL FUNCTION 'CLOSE_FORM'

    EXCEPTIONS

    OTHERS = 1.

    IF sy-subrc NE 0.

    PERFORM protocol_update.

    retcode = 1.

    ENDIF.

    SET COUNTRY space.

    ENDFORM. " FORM_CLOSE

    *&----


    *

    *& Form SHIP_DATA

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM ship_data.

    CLEAR: g_f_count1,g_f_count2,g_f_count3,g_f_count4,g_f_count5,

    g_f_count6,g_f_count7,g_f_count8,g_f_count9,g_f_count10,

    weight.

    shipment_number = nast-objky.

    CALL FUNCTION 'RV_SHIPMENT_PRINT_VIEW'

    EXPORTING

    shipment_number = shipment_number

    option_tvtk = 'X' "Shipmenttype J/N

    option_ttds = 'X' "Disposition J/N

    language = nast-spras

    option_items = 'X' "Transport Items J/N

    option_segments = 'X' "Transport Segments J/N

    option_partners = 'X' "Partners J/N

    option_sales_orders = 'X' "Sales orders J/N

    option_export_data = 'X' "Export data J/N

    option_packages = 'X' "Packages J/N

    option_flow = ' ' "Flow J/N

    option_no_refresh = ' ' "Refresh Tables J/N

    IMPORTING

    f_vttkvb = vttkvb "Shipment Header

    f_tvtk = tvtk "Shipmenttype

    f_tvtkt = tvtkt "Description Shipmenttype

    f_ttds = ttds "Disposition

    f_ttdst = ttdst "Description Disposition

    f_vbpla = vbpla "Packages

    TABLES

    f_vttp = xvttp "Shipment Items

    f_trlk = slk "Delivery

    f_trlp = slp "Delivery Item

    f_vtts = xvtts "Shipment Segments

    f_vtsp = xvtsp "Segments/Items

    f_vbpa = xvbpa "Partner

    f_vbadr = xvbadr "Address

    f_vtfa = xvtfa "Flow

    f_vbplk = xvbplk "Shipment Unit Header

    f_vbplp = xvbplp "Shipment Unit

    f_vbpls = xvbpls "Shipment Unit Sum

    EXCEPTIONS

    not_found = 1.

    IF sy-subrc NE 0.

    PERFORM protocol_update.

    retcode = 1.

    ENDIF.

    */ To get the Company Address using the Transport Number

    SELECT SINGLE * FROM z08v3_cust_befa INTO gs_befa

    WHERE tplst = vttkvb-tplst.

    */ To get the address of the forwarding agent

    READ TABLE xvbadr INDEX 1.

    • fill address key --> necessary for emails

    addr_key-addrnumber = xvbadr-adrnr.

    addr_key-persnumber = xvbadr-adrnp.

    addr_key-addr_type = xvbadr-address_type.

    • PERFORM sender.

    */ To get the INCOTERMS values from table Likp

    *READ TABLE VTTKVB .

    SELECT SINGLE * FROM likp INTO gs_likp WHERE vbeln = xvttp-vbeln.

    • WEIGHT = GS_LIKP-BTGEW.

    f_char = gs_likp-inco1.

    SELECT SINGLE * FROM kna1 INTO gs_kna1 WHERE kunnr = gs_likp-kunnr.

    SELECT SINGLE * FROM t005 INTO iegland WHERE land1 = gs_kna1-land1.

    *To get the Destination Point

    select single * from vtts into g_i_vtts where TKNUM = nast-objky and

    route = VTTKVB-route.

    IF iegland-xegld = 'X'.

    g_flag = '*'.

    ELSE.

    g_flag = ' '.

    ENDIF.

    */ To get the

    SELECT SINGLE * FROM tvstt INTO gs_tvstt

    WHERE spras = sy-langu

    AND vstel = vttkvb-tplst.

    SELECT SINGLE * FROM tvrab INTO gs_tvrab

    WHERE route = vttkvb-route.

    SELECT SINGLE * FROM t173t INTO gs_t173t

    WHERE spras = nast-spras

    AND vsart = vttkvb-vsavl.

    DATA : l_f_space(3) TYPE c,

    l_f_blank(8) TYPE c.

    MOVE: ' ' TO l_f_space,

    ' ' TO l_f_blank.

    SORT xvbplk BY vegr1.

    IF NOT xvbplk[] IS INITIAL.

    LOOP AT xvbplk.

    g_f_btvol = g_f_btvol + xvbplk-btvol.

    • weight = weight + gs_likp-btgew.

    weight = weight + xvbplk-brgew.

    • n = G_F_BTVOL.

    IF xvbplk-vegr1 = 'KIS'.

    IF g_f_var14 CS 'KIS'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'KIS' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'KIS' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count5.

    ENDIF.

    IF xvbplk-vegr1 = 'CAR'.

    IF g_f_var14 CS 'CAR'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'CAR' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'CAR' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count2.

    ENDIF.

    IF xvbplk-vegr1 = 'EPP'.

    IF g_f_var14 CS 'EPP'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'EPP' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'EPP' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count3.

    ENDIF.

    IF xvbplk-vegr1 = 'PBP'.

    IF g_f_var14 CS 'PBP'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'PBP' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'PBP' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count6.

    ENDIF.

    IF xvbplk-vegr1 = 'UNV'.

    IF g_f_var14 CS 'UNV'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'UNV' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'UNV' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count9 .

    ENDIF.

    IF xvbplk-vegr1 = 'VER'.

    IF g_f_var14 CS 'VER'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'VER' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'VER' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count10.

    ENDIF.

    IF xvbplk-vegr1 = 'BEH'.

    IF g_f_var14 CS 'BEH'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'BEH' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'BEH' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count1.

    ENDIF.

    IF xvbplk-vegr1 = 'GBP'.

    IF g_f_var14 CS 'GBP'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'GBP' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'GBP' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count4.

    ENDIF.

    IF xvbplk-vegr1 = 'PKI'.

    IF g_f_var14 CS 'PKI'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'PKI' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'PKI' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count7.

    ENDIF.

    IF xvbplk-vegr1 = 'SPP'.

    IF g_f_var14 CS 'SPP'.

    ELSE.

    IF g_f_var14 IS INITIAL.

    CONCATENATE g_f_var14 'SPP' INTO g_f_var14.

    ELSE.

    CONCATENATE g_f_var14 'SPP' INTO g_f_var14 SEPARATED BY

    l_f_space.

    ENDIF.

    ENDIF.

    ADD 1 TO g_f_count8.

    ENDIF.

    ENDLOOP.

    g_f_btvol = ( g_f_btvol / 1000 ).

    volume = g_f_btvol.

    ENDIF.

    IF NOT g_f_count1 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count1 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count1

    INTO g_f_var15 SEPARATED BY l_f_blank.

    ENDIF.

    ENDIF.

    IF NOT g_f_count2 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count2 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count2

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count3 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count3 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count3

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count4 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count4 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count4

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count5 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count5 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count5

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count6 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count6 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count6

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count7 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count7 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count7

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count8 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count8 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count8

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count9 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count9 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count9

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    IF NOT g_f_count10 IS INITIAL.

    IF g_f_var15 IS INITIAL.

    CONCATENATE g_f_var15 g_f_count10 INTO g_f_var15.

    ELSE.

    CONCATENATE g_f_var15 g_f_count10

    INTO g_f_var15 SEPARATED BY ' '.

    ENDIF.

    ENDIF.

    ENDFORM. " SHIP_DATA

    *&----


    *

    *& Form PROTOCOL_UPDATE

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM protocol_update.

    CHECK xscreen = space.

    CALL FUNCTION 'NAST_PROTOCOL_UPDATE'

    EXPORTING

    msg_arbgb = syst-msgid

    msg_nr = syst-msgno

    msg_ty = syst-msgty

    msg_v1 = syst-msgv1

    msg_v2 = syst-msgv2

    msg_v3 = syst-msgv3

    msg_v4 = syst-msgv4

    EXCEPTIONS

    OTHERS = 1.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    ENDFORM. " PROTOCOL_UPDATE

    *&----


    *

    *& Form WRITE_ADD

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM write_add.

    PERFORM z_form_write USING 'ADDRESS' 'WIN1'.

    PERFORM z_form_write USING 'AUSFUHR' 'WIN4'.

    PERFORM z_form_write USING 'STUTTGART' 'WIN7'.

    PERFORM z_form_write USING 'DATE' 'STAMP'.

    PERFORM z_form_write USING 'ZUST' 'ZUST'.

    PERFORM z_form_write USING 'SHIPMENT' 'BODY'.

    PERFORM z_form_write USING 'SHIPMENT1' 'BODY2'.

    PERFORM z_form_write USING 'ROUTE' 'ROUTE'.

    PERFORM z_form_write USING 'WIN_NEW' 'GPB'.

    PERFORM z_form_write USING 'ADDRESS1' 'WIN5'.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    element = 'MAIN'

    function = 'SET'

    type = 'BODY'

    window = 'MAIN'

    EXCEPTIONS

    element = 1

    function = 2

    type = 3

    unopened = 4

    unstarted = 5

    window = 6

    bad_pageformat_for_print = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    PERFORM protocol_update.

    ENDIF.

    PERFORM z_form_write USING 'SIEGEL' 'WIN_P2'.

    PERFORM z_form_write USING 'FOOTER' 'WINDOW1'.

    • n = G_F_BTVOL.

    PERFORM z_form_write USING 'MAIN2' 'WINDOW2'.

    PERFORM z_form_write USING 'VOLUME' 'WINDOW5'.

    PERFORM z_form_write USING 'MAIN3' 'WINDOW3'.

    PERFORM z_form_write USING 'TEXT' 'WINDOW4'.

    IF NOT l_t_lines[] IS INITIAL.

    LOOP AT l_t_lines.

    • G_F_FIX = L_T_LINES-TDLINE.

    CONCATENATE g_f_fix l_t_lines-tdline INTO g_f_fix.

    ENDLOOP.

    CLEAR: l_t_lines.

    REFRESH: l_t_lines.

    ENDIF.

    ENDFORM. " WRITE_ADD

    *&----


    *

    *& Form ITEM_PRINT_TEXT

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM item_print_text.

    PERFORM get_text1 TABLES g_t_lines USING 'Z032' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z028' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z033' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z035' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z029' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z030' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'Z031' 'VTTK'.

    PERFORM get_text1 TABLES g_t_lines USING 'CM19' 'VTTK'.

    PERFORM get_text TABLES g_t_lines USING 'Z020' 'VBBK'.

    PERFORM get_text TABLES g_t_lines USING 'Z021' 'VBBK'.

    PERFORM get_text TABLES g_t_lines USING 'Z024' 'VBBK'.

    PERFORM get_text TABLES g_t_lines USING 'Z025' 'VBBK'.

    PERFORM get_text TABLES g_t_lines USING 'Z027' 'VBBK'.

    .

    ENDFORM. " ITEM_PRINT_TEXT

    *&----


    *

    *& Form GET_TEXT

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM get_text TABLES g_t_lines STRUCTURE tline

    USING p_var TYPE c

    p_obj TYPE c.

    PERFORM read_text1 TABLES g_t_lines USING p_var p_obj.

    CHECK NOT g_t_lines[] IS INITIAL.

    CASE p_var.

    WHEN 'Z020'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var8.

    WHEN 'Z021'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var9.

    WHEN 'Z024'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var10.

    WHEN 'Z025'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var11.

    WHEN 'Z027'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var12.

    ENDCASE.

    ENDFORM. " GET_TEXT

    *&----


    *

    *& Form READ_TEXT1

    *&----


    *

    • text

    *----


    *

    • -->P_G_T_LINES text

    • -->P_P_NAME text

    *----


    *

    FORM read_text1 TABLES g_t_lines STRUCTURE tline

    USING p_var TYPE c

    p_obj TYPE c.

    READ TABLE xvttp INDEX 1.

    g_f_tdname1 = xvttp-vbeln.

    g_f_obj1 = p_obj.

    g_f_langu1 = 'DE'.

    REFRESH g_t_lines.

    CLEAR g_t_lines.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = p_var

    language = g_f_langu1

    name = g_f_tdname1

    object = g_f_obj1

    TABLES

    lines = g_t_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 <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    IF g_t_lines[] IS INITIAL.

    g_f_langu1 = 'EN'.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = p_var

    language = g_f_langu1

    name = g_f_tdname1

    object = g_f_obj1

    TABLES

    lines = g_t_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 <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDIF.

    ENDFORM. " READ_TEXT1

    *&----


    *

    *& Form GET_TYPE_TEXT

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM get_type_text.

    PERFORM type_text USING '01' g_f_trans. " 05

    g_f_text1 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '10' g_f_trans. " 11/13

    g_f_text2 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '03' g_f_trans. " 25/1

    g_f_text3 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '04' g_f_trans. " 27

    g_f_text4 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '05' g_f_trans. " 46/1

    g_f_text5 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '06' g_f_trans. " 47/1

    g_f_text6 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '07' g_f_trans. " 59/2

    g_f_text7 = g_f_trans.

    CLEAR g_f_trans.

    PERFORM type_text USING '11' g_f_trans. " 76

    g_f_text8 = g_f_trans.

    CLEAR g_f_trans.

    ENDFORM. " GET_TYPE_TEXT

    *&----


    *

    *& Form TYPE_TEXT

    *&----


    *

    • text

    *----


    *

    • -->P_1066 text

    *----


    *

    FORM type_text USING p_text TYPE c

    p_trans TYPE c.

    DATA: lv_lines TYPE sy-tabix.

    SELECT SINGLE * FROM z08v3_texttyp INTO g_r_texttyp

    WHERE texttyp = p_text.

    IF g_r_texttyp-sondertext IS INITIAL.

    SELECT SINGLE * FROM z08v3_transtextt INTO g_r_trans

    WHERE route = vttkvb-route

    AND texttyp = p_text

    AND spras = nast-spras.

    IF sy-subrc = 0.

    p_trans = g_r_trans-text.

    ENDIF.

    ELSE.

    SELECT SINGLE * FROM z08v3_sondertext INTO g_r_sonder

    WHERE texttyp = p_text.

    IF sy-subrc = 0.

    IF p_text = '10'.

    g_f_std = g_r_sonder-tdname.

    ENDIF.

    PERFORM get_text2 TABLES g_t_lines USING g_r_sonder-tdid

    g_r_sonder-tdname.

    READ TABLE g_t_lines INDEX 1.

    IF sy-subrc = 0.

    p_trans = g_t_lines-tdline.

    ENDIF.

    ENDIF.

    ENDIF.

    DESCRIBE TABLE g_t_lines LINES lv_lines.

    IF lv_lines > 1.

    l_t_lines[] = g_t_lines[].

    ENDIF.

    ENDFORM. " TYPE_TEXT

    *&----


    *

    *& Form GET_TEXT2

    *&----


    *

    • text

    *----


    *

    • -->P_G_T_LINES text

    • -->P_G_R_SONDER_TDID text

    • -->P_G_R_SONDER_TDNAME text

    *----


    *

    FORM get_text2 TABLES g_t_lines STRUCTURE tline

    USING p_var TYPE c

    p_obj TYPE c.

    CLEAR g_t_lines.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    client = sy-mandt

    id = p_var

    language = nast-spras

    name = p_obj

    object = 'TEXT'

    TABLES

    lines = g_t_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 <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    ENDFORM. " GET_TEXT2

    *&----


    *

    *& Form CONTROL_FORM

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    FORM control_form.

    CLEAR:p_flag,p_flag1,p_flag2.

    IF g_f_var1 <> '' OR g_f_var2 <> '' OR g_f_var3 <> ''

    OR g_f_var5 <> '' OR g_f_var6 <> '' OR g_f_var7 <> ''

    OR g_f_var8 <> '' OR g_f_var9 <> '' OR g_f_var10 <> ''

    OR g_f_var11 <> '' OR g_f_var12 <> ''.

    p_flag = 'X'.

    p_flag2 = 'X'.

    ENDIF.

    SELECT SINGLE * FROM z08v3_transtextt INTO z_text WHERE route =

    vttkvb-route AND texttyp = '10' AND spras = nast-spras.

    IF sy-subrc = 0.

    p_flag1 = 'X'.

    p_flag2 = 'X'.

    ENDIF.

    IF p_flag = 'X' OR p_flag1 = 'X'.

    CALL FUNCTION 'CONTROL_FORM'

    EXPORTING

    command = 'NEW-PAGE'

    EXCEPTIONS

    unopened = 1

    unstarted = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    ENDIF.

    ENDFORM. " CONTROL_FORM

    *&----


    *

    *& Form SENDER

    *&----


    *

    • text

    *----


    *

    • --> p1 text

    • <-- p2 text

    *----


    *

    *FORM SENDER.

    *

    *ENDFORM. " SENDER

    FORM get_text1 TABLES g_t_lines1 STRUCTURE tline

    USING p_var1 TYPE c

    p_obj1 TYPE c.

    PERFORM read_text2 TABLES g_t_lines1 USING p_var1 p_obj1.

    CHECK NOT g_t_lines1[] IS INITIAL.

    CASE p_var1.

    WHEN 'Z032'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var1.

    WHEN 'Z028'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var2.

    WHEN 'Z033'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var3.

    WHEN 'Z035'.

    • READ TABLE g_t_lines1 INDEX 1.

    • MOVE g_t_lines1-tdline TO g_f_var4.

    LOOP AT g_t_lines1.

    CONCATENATE g_f_var4 g_t_lines1-tdline INTO g_f_var4 SEPARATED BY

    space.

    ENDLOOP.

    condense:g_f_var4.

    WHEN 'Z029'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var5.

    WHEN 'Z030'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var6.

    WHEN 'Z031'.

    READ TABLE g_t_lines1 INDEX 1.

    MOVE g_t_lines1-tdline TO g_f_var7.

    WHEN 'CM19'.

    READ TABLE g_t_lines INDEX 1.

    MOVE g_t_lines-tdline TO g_f_var13.

    ENDCASE.

    ENDFORM. " GET_TEXT

    *&----


    *

    *& Form READ_TEXT2

    *&----


    *

    • text

    *----


    *

    • -->P_G_T_LINES text

    • -->P_P_VAR text

    • -->P_P_OBJ text

    *----


    *

    FORM read_text2 TABLES g_t_lines1 STRUCTURE tline

    USING p_var1 TYPE c

    p_obj1 TYPE c.

    DATA:t_stxh LIKE stxh.

    CLEAR:t_stxh.

    g_f_tdname = vttkvb-tknum.

    g_f_obj = p_obj1.

    g_f_langu = 'DE'.

    REFRESH g_t_lines1.

    CLEAR g_t_lines1.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = p_var1

    language = g_f_langu

    name = g_f_tdname

    object = g_f_obj

    TABLES

    lines = g_t_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 <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    IF g_t_lines[] IS INITIAL.

    g_f_langu = 'EN'.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = p_var1

    language = g_f_langu

    name = g_f_tdname

    object = g_f_obj

    TABLES

    lines = g_t_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 <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDIF.

    ENDFORM. " READ_TEXT2

    *----


    *

    • FORM z_form_write *

    *----


    *

    • ........ *

    *----


    *

    • --> p_element *

    • --> p_window *

    *----


    *

    FORM z_form_write USING p_element

    p_window.

    DATA: window(08), element(20).

    CLEAR:window,element.

    window = p_window.

    element = p_element.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    element = element

    window = window

    EXCEPTIONS

    element = 1

    function = 2

    type = 3

    unopened = 4

    unstarted = 5

    window = 6

    bad_pageformat_for_print = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    PERFORM protocol_update.

    ENDIF.

    ENDFORM.

    Regards

    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.