Report prog

Hi all,
I have a req in report programming where i have 4 selection screens in all.
The 3rd selection screen should appear only after I select values from 1st and 2nd selection screens
and the 4th selection screen should appear after value selection  from the 3rd selection screen is done.
any pointers how to do that?
do i need dialog prog to do this?

use SELECTION-SCREEN: BEGIN OF TABBED BLOCK...using this u can control 4 selection screen in single screen
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 100.
SUBSCREEN 2
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: q1(10) TYPE c OBLIGATORY,
            q2(10) TYPE c OBLIGATORY,
            q3(10) TYPE c OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 200.
STANDARD SELECTION SCREEN
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                  TAB (20) button1 USER-COMMAND push1,
                  TAB (20) button2 USER-COMMAND push2,
                  TAB (20) button3 USER-COMMAND push3
                                   DEFAULT SCREEN 300,
                  END OF BLOCK mytab.
INITIALIZATION.
  button1 = text-010.
  button2 = text-020.
  button3 = text-030.
  mytab-prog = sy-repid.
  mytab-dynnr = 100.
  mytab-activetab = 'BUTTON1'.
AT SELECTION-SCREEN.
  CASE sy-dynnr.
    WHEN 1000.
      CASE sy-ucomm.
        WHEN 'PUSH1'.
          mytab-dynnr = 100.
          mytab-activetab = 'BUTTON1'.
        WHEN 'PUSH2'.
          mytab-dynnr = 200.
          mytab-activetab = 'BUTTON2'.
      ENDCASE.
    WHEN 100.
      MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
    WHEN 200.
      MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
  ENDCASE.
MODULE init_0100 OUTPUT.
  LOOP AT SCREEN.
    IF screen-group1 = 'MOD'.
      CASE flag.
        WHEN 'X'.
          screen-input = '1'.
        WHEN ' '.
          screen-input = '0'.
      ENDCASE.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDMODULE.
MODULE user_command_0100 INPUT.
  MESSAGE s888(sabapdocu) WITH text-050 sy-dynnr.
  CASE sy-ucomm.
    WHEN 'TOGGLE'.
      IF flag = ' '.
        flag = 'X'.
      ELSEIF flag = 'X'.
        flag = ' '.
      ENDIF.
  ENDCASE.
ENDMODULE.

Similar Messages

  • Creating INCLUDE, just like REPORT prog.?

    Hi Experts,
    One simple question, pls. clarify ma that,
    In the process of VA01-Sales Order creation, I need to do not allow to create/save that doc. if PO#, MATNR, Batch r already existing in DB! in this case, I need to write logic in SAPMV45A, I found the corresponding User exit, so, I wanna insert my code as INCLUDE my_prog_code.
    So, to write INCLUDE, Is it just like Report prog.? like, SE38>my_name>create--->Type->INCLDE selection?
    Or any other things I hv to consider, to write a INCLUDE?
    thanq

    That is correct way to create an INCLUDE program. Just make sure that you correctly call the routines in the user exit and give reference of this program.
    Here is a pseudo logic.
    FORM USEREXIT_MOVE_FIELD_TO_VBAK.
    perform validate_DATA(<your include program name>).
    ENDFORM.
    Your code for routine VALIDATE_DATA will be placed in the include program.
    Message was edited by:
            Ashish Gundawar

  • Module Pool+TOP+report prog,, Shuld I move to TEST individually?

    Hi Experts,
    I enhanced one Module Pool Prog., which contains 3 parts i.e.
    1 - Main Module Prog.
    2- Top include
    3- One error report prog. i.e. executable prog.
    So,
    Now, I need to move this main Module prog. to TEST box,
    So,
    1) I guess I need to move to TEST box, all 3 individually, in the order of TOP , ERROR report prog., Main Module pool prog.
    2) Or if I move the Main Module pool to TEST, automatically, SAP picks the rest 2 items, even though I did not moved manually?
    thanq.

    This is depends on ur transport request ,did you save all programs in one request,if so it will go automatically.
    if you create transport request indiviudlly ,then need to transport one by one.
    anyhow check in se10 ->main request - sub request -> check ur objects.

  • Fm in pai vs fm in report prog...

    i'm confused about how and why a function module that doesnt work in the PAI works perfectly in a report prog. Is there a background issue?
    This is theoretical i guess...so any help will def be rewarded for sure

    Preethy,
    the FM which u are using is not released for use by customers. that means, we are not supposed to use it in our custom programs.  We wont get any help from SAP also, if it fails,when we use in our programs.
    the reason must be something related to the commit, as mentioned by another user earlier.  Dialog programming itself is like a LUV with a commit work at end, and this FM has its own commit.. am not sure..just guessing. What are your assumptins from debugging ?
    Why dont you use SO_NEW_DOCUMENT_ATT_SEND_API1 ? we are sure this will work regardless of PAI or report ?

  • In report prog  print pop-up recuried ?

    HI sap experts ,
    i hav created one report program in se38 and on that is hv
    two screen (1.is normal screen and 2.is module dilog scree)
    on module screen there is one pushbutton (print) , now  i want whn i vl click on ('print' pushbutton) a pop-up should display,
    so for that what should i do . plz help me ?
    <REMOVED BY MODERATOR>
    regards
    wasim
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 4:54 PM

    hi
    use the key word Window for defining an smal wind for pop up and call it when u click to that button
    for more help just write window or windows key word in ABAp editor  place the cursur on it and press F1 uhave full description with example
    Cheers
    Snehi Chouhan

  • How to run  Sync RFC from a report prog

    Hi Everybody,
                 COuld you guys pls tell me how to execute Sync RFC using a report. I have written this code but it gives error.
    data wa type c.
    CALL FUNCTION 'Z_HR_NO_ALTINN_TX'  DESTINATION 'Q3A2X7A'
      exporting
        PASSWORD = 'k'
        importing
        status = wa.
    commit work.
    Pls guide.
    Regards,
    Ashish

    Thanks Michal for your reply.
         To answer your questions:
    I tried with commit work.
    data wa type c.
    CALL FUNCTION 'Z_HR_NO_ALTINN_TX'  DESTINATION 'Q3A2X7A'
      exporting
        PASSWORD = 'k'
        importing
        status = wa.
    2) Yes my RFC Destination is working.
    3) Sorry I didn't get your third question. Could you pls elaborate a bit more.
    This is the error i get when i execute the above report.
    <b>ShrtText</b>
        "call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryEx
    <b>What happened?</b>
        Error in ABAP application program.
        The current ABAP program "Z_ALTINN_TEST" had to be terminated because
         the
        statements could not be executed.
        This is probably due to an error in the ABAP program.
        The error occurred in an RFC call to another system.
        The target system has also written a short dump.
        Consult this short dump for more precise information about
        the cause of the error.
    <b>Error analysis</b>
        An error occurred when executing a REMOTE FUNCTION CALL.
        It was logged under the name "RFC_EXTERNAL_ABORT"
        on the called page.
    Ashish

  • Call global class exception to report prog

    Hi expert,
            In  global class, i write a method in that one exception can be raised. that exception can be called in
    report program. please can you help me.
    Thank you,
    dinesh.

    Hello Dinesh
    If your method has just exceptions defined in its signature and NOT exception classes then you can handle them like you do for function module exceptions.
    However, I assume your method has one or more exception classes defined in its signature. Then you can use the TRY...CATCH...ENDTRY block:
    " Here we are in your report:
    DATA: lo_error    TYPE REF TO cx_root.
    DATA: ld_msg    TYPE bapi_msg.
    TRY.
      CALL METHOD go_myclass->method_with_exceptionclass( ).  " e.g. ZCX_MY_EXCEPTION
    CATCH zcx_my_exception INTO lo_error.
       ld_msg = lo_error->get_longtext( ).
      MESSAGE ld_msg   TYPE 'I'.
    ENDTRY.
    Regards
      Uwe

  • Currency Decimal to be corrected according to the currency used(Report prog

    Hi Experts,
    I have one requirement in which  presently, always two decimal places are used for any currency. This does not hold good for cases where decimal places are other than 2. Example, for JPY, no decimal places are used.
    This needs to be corrected while updating in outbound table as well as outbound file which is sent to bank.
    How to solve it?
    Any pointers will be highly appreciated?
    Regards,
    Rahul

    Hi,
    Use SET COUNTRY cntry.
    refer the following code.
    DATA: dat       TYPE sy-datum VALUE '20020127',
          num       TYPE p  LENGTH 8 DECIMALS 2 VALUE '1234567.89',
          t005x_wa  TYPE t005x,
          t005x_tab TYPE SORTED TABLE OF t005x
                    WITH NON-UNIQUE KEY xdezp datfm.
    SELECT *
           FROM t005x
           INTO TABLE t005x_tab.
    DELETE ADJACENT DUPLICATES FROM t005x_tab.
    LOOP AT t005x_tab INTO t005x_wa.
      SET COUNTRY t005x_wa-land.
      WRITE: / num, dat.
    ENDLOOP.
    Best Regards,
    Surendar Reddy.

  • Z_Dialog prog initial input screen-looking like selection screen of Report?

    Hi Experts,
    In internet, I found 2 screens( code is not mentioned there) and mentioned that, they r Dialog Prog. screens, they r as below,
    1 - Initial input screen-programmer mentioned it as a selection screen-1000
    2 - Output screen in ALV grid (Object ALV)
    So, when I saw this initial input screen, it looks like same as selection screen 1000 of a report prog., I mean, its containing all selection screen components, like Select-options with out interval, with out extension, blocks, titles for these blocks!!
    So,pls. let me know that,
    1) How the programmer achived this screen? is he used like,
    SELECTION SREEN 1000 START
    END OF SELECTION SCREEN 1000
    2) How these input fileds r looking like select-optins, parameters,  blocks etc.?
    thanq

    Putting selection screens on dialogue transactions have been covered before in the forum. Please search.
    Rob

  • How to add a report into the SAP-SCRIPT .using PERFORM ......ENDPERFORM

    My question is that How to add a report into the SAP-SCRIPT .
    by using PERFORM ......ENDPERFORM
    I don't know how to used it .

    Hi Sandeep,
    Please check this link
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
    http://www.allinterview.com/showanswers/37425.html
    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.
    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 (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) 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 u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Best regards,
    raam

  • Adding Vendor Descrption for  standard report in  mb51.........

    Hi
    Experts....
       i am using MB51  Standard Report..
    i want  to add the vendor description to  this standard report...
    please suggest in  any procedure..
    hw can i write coding  for  add the descrption in  satndard program.
    Thanks & Regards..
    Spanadana...

    Hi,
    Better to copy the standard report prog into Z prog and modify that.
    Regards,

  • Reports in SAPScripts

    Please anybody tell me how to call reports in SAP Scripts?

    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,
    Vara

  • How to define RADIO BUTTONS in MODULE POOL PROG.?

    Hi Experts,
    I need to keep the RADIO BUTTONS in 1000_screen of my_module_pool prog., like,
    I hv 2 fields in this screen, as expected, the first shuld hv DEFAULT selection.
    So, I just simply, dragged & dropped 2 radio buttons from left menu of the screen builder & given them the  names as
    R_SUMMARY
    R_DETAIL
    Then i executed the transaction, but, these above 2 fields are getting selected, as default??
    I know that, if its a REPORT prog. we can define as w/ a GROUP, then the 1st one is hv the default selection.
    so,
    1  - How to define RADIO BUTTONS in this screen of a module pool prog.
    2 - How to use these names in the prog.(PAI - i guess)?
    thanq
    Edited by: Srinivas on Jul 12, 2008 11:59 PM

    Hi Srinivas,
    Please check this link
    Re: urgent:Regd radio buttons in module pool
    http://saplab.blogspot.com/2007/10/sample-abap-program-for-module-pool_18.html
    http://****************/Tutorials/ABAP/Checkbox/page1.htm
    http://****************/Tutorials/ABAP/Checkbox/page2.htm
    Best regards,
    raam

  • Read report line too long error ?

    hi friends.
    my program allowed this error.
    read_report_line_too_long
    what do I do ?
    help me please

    Don't do any setting changes, try to modify the code if it is custom namespace.
    assume this the code with more than 72chars..
    read table itab into wa_itab with key matnr = v_matnr  vbeln = vbeln transporting something binary search
    you have to break that into two lines like the below..
    read table itab into wa_itab with key matnr = v_matnr
                                                  vbeln = vbeln
                               transporting something binary search
    where ever you find the line more than 72 chars you change it. not event comment lines should not exceed more than 72 chars.
    what are you doing exactly can you let me know..
    if you are using READ REPORT if you have a program with more than 72 chars length then you will end up with that error. see the standard SAP documentation
    DATA prog TYPE c LENGTH 30.
    DATA itab TYPE TABLE OF string.
    prog = '...'.
    READ REPORT prog INTO itab.
    Catchable Exceptions
    CX_SY_READ_SRC_LINE_TOO_LONG
    Cause: At least one line of the source code is longer than the rows of the internal table itab.
    Runtime Error: READ_REPORT_LINE_TOO_LONG

  • Exceptions handling  for  "submit of  Insert Report "

    Dear Experts,
    i need to handle Exception "syntax Error" when Submit the inserted report.
    i tried " try and Catch " but failed to catch Dump Error.
    for example:
    Data  CODE TYPE  TABLE OF String .
    APPEND   'REPORT ZDYN.'                                 TO Code .
    APPEND 'Data Var1 type I   .'          TO Code .
    append 'if var > 10 '                         to Code .
    append 'Write ''Success''  .  '            to Code .
    append 'else. '                                  to Code .
    append 'Write ''Failed'' . '                   to Code .
    append 'EndIf . '                               to Code .
    TRY .
        data Prog TYPE c LENGTH 50 VALUE  'ZDYN'.
        INSERT REPORT Prog FROM CODE .
        SUBMIT Prog AND RETURN .
      CATCH CX_ROOT  .
        raise SYNTAX_ERROR .
    ENDTRY.
    " in the inserted Report the Variable Name is Var1 NOT Var So it will be Syntax error " DUMP Error ".
    Thanks in advance

    Hi,
    First write the code in a program and check what error you get and try to handle that particular error.
    Also a full stop is missing in the code ...
    REPORT ZDYN.
    Data Var1 type I.
    if var > 10 .
    Data CODE TYPE TABLE OF String .
    APPEND 'REPORT ZDYN.' TO Code .
    APPEND 'Data Var1 type I .' TO Code .
    append 'if var > 10 .' to Code . <--  Put a full stop here ..
    append 'Write ''Success'' . ' to Code .
    append 'else. ' to Code .
    append 'Write ''Failed'' . ' to Code .
    append 'EndIf . ' to Code .
    Regards,
    Srini.

Maybe you are looking for