Use of subroutine in SapScript

Hi Friends,
              I am passing two parameters as input from sapscript perform statement and i want one field from database table as output.
              In abap editor i have created two internal tables of the type ITCSY for input and output parameters. <b>The name field of the internal table i have created is getting populated but the corresponding value field is not getting populated,</b> so my further logic is not processed and i am not gettin the desired result i.e. it it displaying nothing.
             Can you guide me on the same?
Regards,
Nikhil

Hi,
My code is as follows in which i have ynbemployeetable in database from which i am taking empname and empgender as input and i want  empid as output.
I have written following perform statement in se71.
PERFORM GET_DETAILS IN PROGRAM ZNIK_SSCRIPT_NEW_AS5
USING &YNBEMPLOYEETABLE-EMPNAME&
USING &YNBEMPLOYEETABLE-EMPGENDER&
CHANGING &EMPID&
ENDPERFORM
I have written following form in se38 abap editor. in this the input-value field is not getting populated.
FORM get_details TABLES input STRUCTURE  ITCSY
                        output STRUCTURE ITCSY.
DATA : z_empname LIKE ynbemployeetable-empname,
            z_empgender LIKE ynbemployeetable-empgender,
            z_empid type i.
READ TABLE input with key 'YNBEMPLOYEETABLE-EMPNAME'.
CHECK sy-subrc = 0.
z_empname = <b>input-value</b>. "Not getting populated
READ TABLE input with key 'YNBEMPLOYEETABLE-EMPGENDER'.
CHECK sy-subrc = 0.
z_empgender = <b>input-value.</b>  "Not getting populated
SELECT SINGLE empid FROM ynbemployeetable
INTO z_empid
WHERE empname = z_empname and empgender = z_empgender.
output-name = 'EMPID'.
MOVE z_empid TO output-value.
MODIFY output INDEX 1.
ENDFORM.
Can you help me know why it is not getting populated and what is the mistake?

Similar Messages

  • Use of subroutines in SAPScripts

    When we are calling a subroutine from Script is it possible to retrieve an internal table from the program and use it in the script for printing data?
    for eg:PERFORM <subroutine name> IN PROGRAM <program name> using<var1>
    chnging<var2>.Can Var1 or var 2 be an internal table?

    hi Savitha,
    Var1 and Var2 are defintely tables, but does not serve the purpose of passing internal table values from print program. They are tables of structure ITCSY which has only two fields, NAME (field name) and VALUE (field value). Meaning for one field, there can be only one entry.
    Please see the code attached below:
    PERFORM get_attn IN PROGRAM zprogname USING var1 CHANGING var2.
    FORM get_attn TABLES in_tab STRUCTURE itcsy
                         out_tab STRUCTURE itcsy.
      DATA: v_name2 TYPE kna1-name2,
            v_attn TYPE string,
            v_kunnr TYPE knvk-kunnr,
            v_offset TYPE i,
            err_str TYPE string,
            w_tab   TYPE itcsy.
    * Get Customer Number
      READ TABLE in_tab INTO w_tab WITH KEY name = 'DKADR-KONTO'.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    INTO err_str .
      ENDIF.
    * Get Assistant name
      MOVE w_tab-value TO v_kunnr.
      v_offset = 10 - STRLEN( v_kunnr ).
      SHIFT v_kunnr RIGHT BY v_offset PLACES.
      OVERLAY v_kunnr WITH '0000000000'.
      SELECT SINGLE name2 FROM kna1 INTO v_name2
                          WHERE kunnr = v_kunnr.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    INTO err_str .
      ENDIF.
      CLEAR w_tab.
      READ TABLE out_tab WITH KEY name = 'ATT_NAME' INTO w_tab.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    INTO err_str .
      ENDIF.
      MOVE v_name2 TO w_tab-value.
      MODIFY out_tab INDEX sy-tabix FROM w_tab.
    ENDFORM.                    "get_attn
    Hope this helps,
    Sajan Joseph.

  • How to find the sapscripts using certain subroutines?

    Hi all,
    I have to find out the list of sapscripts using a subroutine of a program, i.e. inside the sapscripts, there is a script "perform XXX in program YYY".
    Any quick method to find out a list of sapscripts using subroutine XXX with program YYY?
    Thanks.

    Hi,
    I don't thing there is a table or functionality.  check the documents for that program if maintained.
    Cheers,
    Sasi

  • Subroutine in sapscript for net due date

    Hi,
    This is the first time I am creating a subroutine for sapscript and I could not get it to work. I need to calculate the net due date using the baseline date plus cash discount days. But the form is just printing out 0000000. I am just trying to extract one due date here but I will have to get it for all line items then sort descending to get the latest one. Can anyone help me to see the gap why this is not working?
    In the sapscript I have the following:
    DEFINE &BASEDATE& = &REGUP-ZFBDT&
    DEFINE &PAYTERMS& = &REGUP-ZBD1T&
    PERFORM NET_DUE_DATE IN PROGRAM Z_SAPSCRIPT_FUNCTIONS
    USING &BASEDATE&
    USING &PAYTERMS&
    CHANGING &DUEDATE&
    ENDPERFORM
    In program Z_SAPSCRIPT_FUNCTIONS
    Thanks in advance!
    Cholen

    Hi Raju!
    I am really getting close! I did the conversion for all variables, however for VBLNR, it does not work. It gives leading zeroes but the value starts with a 'P' before the zeroes and the numeric value. I tried to remove that from the where clause and my select finally got something. However the output on the form is in the internal format. I suppose I should use CONVERT_DATE_TO_EXTERNAL which I tried doing after out_tab-value = lv_netduedate which is the variable I am passing to the form. 
    Raju Shrestha wrote:
    Hi Cholen,
    I believe your lv_laufd is a 10 character field in format MM/DD/YYY or DD/MM/YYYY. You should move that data to a 8 character variable (say lv_date) in YYYYDDMM format.
    Please try this conversion
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
          EXPORTING
            date_external            = lv_laufd
          IMPORTING
            date_internal            = lv_date
          EXCEPTIONS
            date_external_is_invalid = 1
            OTHERS                   = 2.
    Check in debug, you should get lv_date in YYYYMMDD. Now use lv_date in your WHERE clause.
    If you still do not get data after lv_date eq YYYYMMDD, check your LIFNR and KUNNR. They should be 10 charaters with leading zeroes if not 10 .
    If needed use the conversion for lv_lifnr and lv_kunnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            date_external            = lv_lifnr
          IMPORTING
            date_internal            = lv_lifnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            date_external            =  lv_kunnr
          IMPORTING
            date_internal            =  lv_kunnr.
    Cheers,
    Raju.

  • Use of subroutine entry in form processing

    Hi,
    Can anybody pls explain the use of subroutine ENTRY and what it has got to do with output type. Im working on script and smartforms and need to know the process behind it. I hope i explained my question well.
    Rgds
    Sid

    Your configuration usually points to a formname, a program, and an start subroutine for SAPScript, at least.  SAP routinely named the start subroutine ENTRY.  Inside ENTRY, you will see that what usually happens is a reference to the structure NAST, where output controls, like copy counters, etc.,  and the document number (OBJKY) are stored and passed into the output form driver program.

  • Problem in calling ABAP Subroutine from SAPSCRIPT

    Hi,
    I need to get the reason for cancellation of a Business Even in Training & Event Management module, so I am passing Emp_id.
    But the reason(CAAATRT) is returned with blank by the code.
    please help.
    /:DEFINE &EMP_ID&= &PPVAR-TOBJD&
    /:PERFORM HR_REASON_PRINT IN PROGRAM ZHR_REASON_PRINT
    /:USING &EMP_ID&
    /:CHANGING &CAATRT&
    REPORT  ZHR_REASON_PRINT.
    DATA : BEGIN OF in_par OCCURS 10.
            INCLUDE STRUCTURE itcsy.
    DATA : END OF in_par.
    DATA : BEGIN OF out_par OCCURS 0.
            INCLUDE STRUCTURE itcsy.
    DATA : END OF out_par.
    DATA:   TOBJD TYPE PPVAR-TOBJD,
            ADATANR TYPE HRP1001-ADATANR,
            CAATR TYPE HRPAD25-CAATR,
            CAATRT TYPE T77CART-CAATRT,
            EMP_ID TYPE C.
    TABLES     : PPVAR,
             HRP1001,
             HRPAD25,
             T77CART.
    FORM HR_REASON_PRINT TABLES input output.
    in_par[] = input[].
    out_par[] = output[].
    READ TABLE in_par INDEX 1.
    CHECK sy-subrc = 0.
    TOBJD = in_par-value.
    MOVE in_par-value TO TOBJD.
    SELECT ADATANR
    into ADATANR
    FROM HRP1001
    WHERE OBJID EQ TOBJD.
    ENDSELECT.
    SELECT CAATR
    into CAATR
    FROM HRPAD25
    WHERE ADATANR EQ ADATANR.
    ENDSELECT.
    SELECT CAATRT
    INTO CAATRT
    FROM T77CART
    WHERE CAATR EQ CAATR.
    ENDSELECT.
    REFRESH out_par.
      out_par-name = 'DREASON'.
      move CAATRT To out_par-value.
      MODIFY out_par INDEX 1.
    APPEND out_par.
      output[] = out_par[].
    Thanks
    Ramakrishna

    Hi ramakrishna,
    1. while calling subroutines from sapscripts,
    there is a special technique,
    which has got its own limitations.
    2.
    FORM abc
    TABLES
    in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    ENDFORM.
    3. The perform in se38 program should be of the
    above format only.
    4. We cannot pass internal tables.
    5. Rather we need to pass
    VARIABLE NAME
    VARIABLE VALUE
    (see the structure of itcsy in se11)
    6. In this form, we have to read
    the internal table in_tab
    to capture the variable name and its value.
    7. Similary, to return the values,
    we have to put one record (for each variable)
    in out_tab.
    regards,
    amit m.

  • Pass subroutine to Sapscript

    sir,
      Like to know How we pass subroutine in sapscript and how standard texts are added and what is its command and transaction.
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 4:45 PM

    Subroutines in scripts:
    Calling ABAP Subroutines: PERFORM
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: 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.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.

  • Using external subroutine

    my subroutine is written in one program.
    I m using it in another program.
    i checked with the breakpoint...
    The control goes to the subroutine fetches the data in the structure but when the control returns to the main program the structure is empty.
    Now wat should i do either write the routine in the same program or have to use import & export memory which is best based on performance.

    hi
    let us also the location of the subroutine..i mean in differnt client no or in the same. If the subroutine is in the same client no..then you can use the Perform statement in the sapscript to call the extra functionality from the print program or in any location but with in the same system(client).
    In case of external subroutine, i think you need to use the client-specified statement in the print program while selecting the data.
    eg.
    select f1
              f2
              f3
              from zzkna1
              into i_tab
              cleint-specified where mandt = <client no from where you are fetching the data>
    this may work.
    regards,
    shamim.

  • Calling subroutine in sapscript

    can anyone guide how 2 call subrouting in sapscript and i need sample code...i need a simple code how 2 call and implement
    so tat it ll be easy 4 me learn..

    hi,
      You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: 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.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    regards,
    veeresh

  • Calling subroutines from SAPScript

    Hi all,
    I have added a piece of code in my MAIN window which calls a subroutine in another program. This works just fine. However, when I moved the code from one <b>window element</b> of MAIN to another, the code is no longer triggered.
    What causes this to happen? Is it related to the calling of function module WRITE_FORM in the application program? Any ideas?
    All helpful answers will be rewarded!
    Regards,
    M.V.

    Hi,
    In some case we need to do some mathematical operations in scripts !! Those things we cant do in Script Editor !! thats y the subroutines are there in scripts !!
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    Syntax in a form window:
    /: 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.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    Regards
    Rama.Pammi

  • External subroutine in sapscript

    hi all
    can anyone explain me how to handle an external subroutine in a script with a simple example.
    rg
    sandeep

    Hi Sandeep,
    Try this :
    Use PERFORM from SAPSCRIPT
    /: PERFORM BIN_LOCATION IN PROGRAM Z_SAPSCRIPT_PERFORMS
    /: USING &RESBD-MATNR&
    /: USING &CAUFVD-IWERK&
    /: USING &RESBD-LGORT&
    /: CHANGING &MARD-LGPBE&
    /: ENDPERFORM
    REPORT z_sapscript_performs.
    SUBROUTINES FOR CALLING FROM SAPSCRIPTS
    FORM bin_location TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    get default bin location from MARD for this material/plant/storage *
    location
    DATA: l_matnr TYPE matnr, "material
    l_werks TYPE werks, "plant
    l_lgort TYPE lgort, "storage location
    l_lgpbe TYPE lgpbe. "bin location
    Get first parameter in input table.
    READ TABLE in_tab INDEX 1.
    WRITE in_tab-value TO l_matnr .
    Get second parameter in input table
    READ TABLE in_tab INDEX 2.
    MOVE in_tab-value TO l_werks.
    Get third parameter in input table
    READ TABLE in_tab INDEX 3.
    MOVE in_tab-value TO l_lgort.
    read bin location
    SELECT SINGLE lgpbe INTO l_lgpbe FROM mard
    WHERE matnr = l_matnr
    AND werks = l_werks
    AND lgort = l_lgort.
    IF l_LGPBE IS INITIAL.
    l_LGPBE = 'NONE'.
    ENDIF.
    read & update only parameter in output table
    READ TABLE out_tab INDEX 1.
    out_tab-value = l_lgpbe.
    MODIFY out_tab INDEX 1.
    ENDFORM.
    Regards,
    Lanka

  • How to use standard text in sapscripts

    Hi,
    I want to place a part of text to be displayed in my sapscript in the form of a standard text. I want to make the text bold with italics and also want to set a perticualr size to it.
    I am new to SAPscripts can anybody please help me with this.
    regards

    hi
    Use character formats in the script itself for  the specific text. and in it mention font as bold and italic
    and in text elements keep the text between  <C1>......</> where C1 is your character format
                 or
    create global style with
    U can adjust the bold formats in the standard text itself.(se72).
    In the standard text give the character formats and apply them in the text editor of ur sapscript as
    text between  <C1>......</>
    In the text editor go to insert -> text elements-> and standard text.
    u can give the standard text name there.
    regards
    prasanth

  • Using STRLEN in a sapscript form

    I
    How can i use STRLEN function in a sapscript ?
    I want to know lenght of a variable (&EKKO-TZX01&) and if's less than 40 char's I want put spaces until 40 char's.
    It's possible in sapscript ?
    Thanks

    For ur requirement
    You can replace leading spaces in a value with a fill character. Use the F option with the character immediately following the F in the specification as the fill character.
    Syntax
    &symbol(F f )&
    f = fill character
    Eg.:
    Initially if &KNA1-UMSAT& -> 700.00
    &KNA1-UMSAT(F*)& -> **700.00
    So u can use &ekko-txz01(F )&
    Regards,
    Prashant

  • Debuggin External subroutine in sapscript

    Hi Gurus,
    I need to debug external soubroutine written in sapscript.i am not getting how to proceed for this.please help me.
    Regards
    Sam
    Moderator message: sapscript debugging = FAQ, please search before posting.
    Edited by: Thomas Zloch on Oct 27, 2010 1:25 PM

    Hi,
          I think this may help
    Place a break point in your subroutine, now activate the sap script debugger.
    Press F5 and continue debugging in sap script once it reaches the statement where the routine is called it will take you to the code.
    regards

  • PROBLEM IN SUBROUTINE IN SAPSCRIPT!

    CAUFVD IS A STRUCTURE. WHICH HAS ORDER NO 10000427.
      IAM USING CAUFVD COZ RESB-AUFNR IN PERFORM DOESNOT GIVE A VALUE IN SAP SCRIPT.
      CAUFVD-AUFNR = 10000427
      RESB-AUFNR IN SE11 GIVES THE FOLLOWING.
      RESB-AUFNR = 000010000427
      RESB-RSNUM = 0000005126
      PROBLEM IS THAT IN SELECTION ITS PICKING 10000427 WHEREAS I NEED 000010000427.
      HOW DO I DO THIS?
      PLEASE MENTION COMPLETE STEPS OR MODIFY THE EXISTING.
    PERFORM YE_PM_COMMON_RESERV_PR IN PROGRAM ZPMLINCLUDE
    USING &CAUFVD-AUFNR&   "RESB-AUFNR WONT WORK. SO IAM USING CAUFVGD-AUFNR.
    CHANGING &CONV_RESERV&
    CHANGING &CONV_PR&
    CHANGING &CONV_PR&
    ENDPERFORM.
    PERFORM ZPM_COMMON IN PROGRAM ZPMLINCLUDE
    USING &CAUVFD-AUFNR& "ORDER NO
    CHANGING &CONV_RESERV&
    ENDPERFORM.
    FORM ZPM_COMMON
       TABLES IN_TAB STRUCTURE ITCSY
              OUT_TAB STRUCTURE ITCSY.
    DATA : V_AUFNR TYPE RESB-AUFNR, "ORDER NO 
           V_RSNUM TYPE RESB-RSNUM. "RESERVATION NUMBER
    READ TABLE IN_TAB INDEX 1.
    MOVE IN_TAB-VALUE TO V_AUFNR.
    SELECT SINGLE RSNUM FROM RESB INTO V_RSNUM
    WHERE AUFNR = V_AUFNR.
    READ TABLE OUT_TAB INDEX 1.
    OUT_TAB-VALUE = V_RSNUM.
    MODIFY OUT_TAB INDEX 1.
    CLEAR OUT_TAB.
    ENDFORM.
    REGARDS
    ESSAM ([email protected])

    Hi
    Check out the changes in BOLD
    FORM ZPM_COMMON
    TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    DATA : V_AUFNR TYPE RESB-AUFNR, "ORDER NO
    V_RSNUM TYPE RESB-RSNUM. "RESERVATION NUMBER
    READ TABLE IN_TAB INDEX 1.
    MOVE IN_TAB-VALUE TO V_AUFNR.
    **CALL THIS FUNCTION TO CONVERT FOR OUTPUT FORMAT TO
    ***INTERNAL FORMAT I.E WITH LEADING 0.
    <b>CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      Exporting
          INPUT = V_AUFNR
      Importing
          OUTPUT = V_AUFNR.</b>
    SELECT SINGLE RSNUM FROM RESB INTO V_RSNUM
    WHERE AUFNR = V_AUFNR.
    READ TABLE OUT_TAB INDEX 1.
    <b>**OUT_TAB-VALUE = V_RSNUM.</b><b>write v_rsnum to out_tab-value left-justified.</b>
    MODIFY OUT_TAB INDEX 1.
    CLEAR OUT_TAB.
    ENDFORM.
    <b>Reward if Helpful.</b>

Maybe you are looking for

  • Data Source Creation in R/3

    Hi all.    I need to extract the data from multiple tables from R/3. For that I am creating a datasource using RSO2. In this scenario do I need choose extraction from  view ( IN rso2)& create a view combining these tables & use this in data source cr

  • Can you quick fill a format?

    Hello. I'm trying to do some presentation cards for school. I have the format ready, all I need to do is to fill the gaps with the kids names. The problem is, there's over 500 kids. I was wondering if there was a tool or something to quick fill the f

  • Differences between solaris Intel and solaris Sparc

    Hi, I'm new to this solaris world. But I've been using other flavour of unix. I just wondering if somebody could explain to me the differences between Intel version and Sparc version, please? If you have any website that explain it all would be great

  • Saving reports to Browser

    Hi, I just want to clarify something about the browser. When there are roles setup for end-users, and actually the Security or Basis person can put the queries into the roles from PFCG for the end-users to run their own queries. Is this correct? I di

  • Why is Quicktime 7.1 hanging up my computer playing video files?

    Please, I need help because this is way frustrating. I bought an iPOD 5th gen 60 Gb and QT 7.1 Pro to convert my video files and sync them with my iPOD. My computer hangs up every time I try and play a local video file from my hard drive. (Same thing