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

Script

Hi Experts,

i have a standard script . i need to modify it. am new to script. i don't how to write in

FORM TABLE TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

and how to call in the layout.

i have 5 fields which i need .

Invoice Date -


REGUH u2013 VBLNR-REGUP-VBLNR, go to BSAK table, REGUH-VBLNR=BSAK-AUGBL, take BSAK-BLDAT

Invoice number--- BSAK-BELNR

Purchase Order-- BSAK u2013 EBELN

Description--BSAK u2013 SGTXT

Amount --BSAK-WRBTR

these are the fields which i need to write in the se38 part and call them to the layout.

can any 1 please help me .

Correct answers will be fully appriciated.

Regards,

Sunita.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 05:02 AM

    Hi Sunita,

    In SE38 you can write your perform as

    FORM get_details TABLES in_tab STRUCTURE itcsy

    out_tab STRUCTURE itcsy.

    ----


    • Workareas and Variables Declaration

    ----


    DATA : wa_namp1 LIKE t001s,

    wa_telf1 LIKE fsabe,

    l_bukrs LIKE mhnk-bukrs,

    l_kunnr LIKE mhnk-kunnr,

    l_busab LIKE knb1-busab.

    ----


    • Reading Data From Sapscript

    ----


    READ TABLE in_tab WITH KEY name = 'MHNK-BUKRS'.

    IF sy-subrc = 0 .

    MOVE in_tab-value TO l_bukrs.

    ENDIF.

    READ TABLE in_tab WITH KEY name = 'MHNK-KUNNR'.

    IF sy-subrc = 0 .

    MOVE in_tab-value TO l_kunnr.

    ENDIF.

    ----


    • FM to Convert Data From Sapscript

    ----


    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

    EXPORTING

    input = l_kunnr

    IMPORTING

    output = l_kunnr.

    ----


    • Fetching the Clerk Number

    ----


    SELECT busab

    FROM knb1 UP TO 1 ROWS

    INTO l_busab

    WHERE kunnr = l_kunnr AND bukrs = l_bukrs.

    ENDSELECT.

    ----


    • FM for getting Credit Analyst Name,phone and email.

    ----


    CALL FUNCTION 'CORRESPONDENCE_DATA_BUSAB'

    EXPORTING

    i_bukrs = l_bukrs

    i_busab = l_busab

    IMPORTING

    e_t001s = wa_namp1

    e_fsabe = wa_telf1.

    ----


    • Read subroutine parameters and store in variables.

    ----


    READ TABLE out_tab WITH KEY name = 'L_SNAME'.

    IF sy-subrc = 0 .

    MOVE wa_namp1-sname TO out_tab-value.

    MODIFY out_tab INDEX sy-tabix.

    ENDIF.

    READ TABLE out_tab WITH KEY name = 'L_TELF1'.

    IF sy-subrc = 0 .

    MOVE wa_telf1-telf1 TO out_tab-value.

    MODIFY out_tab INDEX sy-tabix.

    ENDIF.

    ENDFORM. "get_details.

    whereas in SAP script SE71 you can write

    /:perform get_details in program "Program name in SE38"

    /: Using &MHNK-BUKRS&

    /: Using &MHNK-KUNNR&

    /: Changing &L_SNAME&

    /: Changing &L_TELF1&

    /:endform.

    Thanks

    Ankur

    Edited by: Ankur Sharma on Jul 23, 2008 7:03 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 02:12 AM

    Hi,

    To call the external subroutine in the layout use the below syntax:

    /: PERFORM <perform name> in program <program name>

    /: using &field-name1&

    /: using &field-name2&

    /: changing &field-name&

    /: ENDPERFORM

    the ITCSY input structure will have the values passed from the USING parameters of the layout. And based on these values you can write logic in the print program and the pass the required value to the layout throogh the OUTPUT structure of the ITCSY.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 02:46 AM

    Hi,

    Please go thruogh these links

    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

    and

    http://www.allinterview.com/showanswers/37425.html

    Hope you understand now.

    Thanks,

    Phani Diwakar.

    Edited by: MVPhani Diwakar on Jul 23, 2008 4:47 AM

    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.