Small issue in dialog program

Hello all,
i have a requirement in dialog programming.
I have to modify a record a record which exist in zatble.
For each record , i have a header info, item details.
for header iam ok , i can use modify.
for item details i have like
itemno    material     materialdesc quantity
1          m1           pqr          12
2          m2           def          9
3          m3           abc          2
4          m4           xyz          1
item no and material are my primary keys.
so iam retrieving this data from a z table and have to update.
may be i need to delete 3 record and modify 2 record,i would do that based on the selectionfrom table control
itemno    material     materialdesc quantity
1          m1           pqr          12
2          m2           def          19
3          m4           xyz          1
now i have deleted 3 record and modifed 2 with increase in quantity and the itemno are changed
I have ths data in my internal table.
iAM USING MODIFY STATEMNT WHEN I SAVE THE DATA INTO DATABASE TABLE.
i SEE THE FOLLOWING DAT AIN MY ZTABLE
1          m1           pqr          12
2          m2           def          19
3          m3           abc          2
4          m4           xyz          1
3          m4           xyz          1
THOGHT I NEED ONLY THESE DATA TO BE PRESENT IN MY ZTABLE
1          m1           pqr          12
2          m2           def          19
3          m4           xyz          1
Any help or suggestions regarding this
Thanks
Suchitra

Hi suchitra,
do one thing ,,
first task
1.first of all select all the contents of ztable based on primary keys into a internal table itab.
1 m1 pqr 12
2 m2 def 9
3 m3 abc 2
4 m4 xyz 1
2. in ur m-pool table control u r performing the operations like delete and modify to the table control GET THE CONTENTS INTO UR FINAL TABLE JTAB ..Lets say
This is ur final jtab.
1 m1 pqr 12
2 m2 def 19
4 m4 xyz 1
NOW PERFORM COMPARISIONS,
3.  LOOP AT ITAB.
    READ TABLE JTAB WITH KEY ITEMNO = ITAB-ITEMNO
                                                   AND MATNR  = JTAB-MATNR
                                                    And  menge     =  jtab -menge       
          IF SY-SUBRC <> 0.
            ITAB-ITEMNO  = JTAB-ITEMNO.
            ITAB_MATNR   = JTAB-MATNR.
            ITAB_MATDESC = JTAB_MATDESC
            ITAB_MENGE   = JTAB_MENGE
            MODIFY  ITAB. ”TRANSPORTING 
          ENDIF.
          ENDLOOP.
THIS WILL COVER RECORD 2 IN UR ITAB CHANGES ARE OK  ..
second task ..
4. NOW SINCE U HAVE DELETED RECORD 3 ,, PLACE  IN AN EXTRA FILED IN THE JTAB  STRUCTURE
LIKE CHAR TYPE C, SAME HAS TO BE IN ITAB ALSO
AND MAKE IT X WHEN EVER U DELETE IT IN TABLE CONTROL
LIKE THIS THE O/P IM EXPECTING HERE IS IN JTAB
1 m1 pqr  12
2 m2 def   19
3 m3 abc    2     x
4 m4 xyz   1
LOOP AT ITAB.
    READ TABLE JTAB WITH KEY ITEMNO = ITAB-ITEMNO
                                                   AND MATNR  = JTAB-MATNR
IF JTAB-CHAR = ‘X’.
            ITAB-ITEMNO     = JTAB-ITEMNO.
            ITAB_MATNR      = JTAB-MATNR.
            ITAB_MATDESC = JTAB_MATDESC
            ITAB_MENGE      = JTAB_MENGE
            ITAB-CHAR          = JTAB-CHAR
            MODIFY  ITAB.  ”TRANSPORTING 
          ENDIF.
  ENDLOOP.
NOW THE ITAB CONTENT IS
1 m1 pqr  12
2 m2 def   19
3 m3 abc    2     x
4 m4 xyz   1
My suggestion to u is modify the ztable from itab .
Without deleting entry 3
This will solve ur prob .
Cause when u do a select next time
Select entries where  char <> ‘X’
Which will fetch u
1 m1 pqr 12
2 m2 def 19
4 m4 xyz 1
Try to bring the logic in a single loop this will do
i have split this for ur understanding ....

Similar Messages

  • Reg: Dialog Programming

    Dear All,
    I'm new to this group.
    Now i'm learning ABAp.
    I need a small Help.
    I want to insert/Update the data into master tables using Dialog Programming.
    How can i do that.
    I'm using RF(Radio frequency)devices,which can access the SAP Screens in Character Based Format and from those devices i want to update/recieve the Data in the database.
    Please send me the procedure/Code.
    Thanks  & Regards,
    Adi.

    Hai Sateesh,
    Thanks for your reply.
    I'm using RF Hand Held Devices & Barcode Technology for stores Automation.
    I want the dialog programming as when ever the user scan the barcode of the particular material,the system will automatically check the Databse and need to show the details of that Particular Material.
    For issuing & reciveing & for stock verification i want the dialog programming.
    In this How to use BDC's /BAPI's. what isa the advantage of using BDC's/BAPI's?
    i don't know much about BAPI Programming.
    I devloped one small Dialog Program...
    The code look like this.
      Delaration of Tables.
      Internal table Declaration.
      In the PAI Event.
      Case sy-ucomm.
      when 'save'.
      insert mara.
      when 'disp'.
      select * from mara where matnr = itab-matnr.
      endselect.
      when 'exit'.
       leave program.
      endcase.
      in the PBI Event
      Move-correspondin itab to mara.
      with this code i'm able to get the values what ever i entered,and i'm able to save.
    What is use of BAPI's & what is the Advantage?
    Please Reply me.
    Regards,
    Adinarayana.B

  • Dialog programming, data being washed out in TAB Control

    Hi,
         i am working on dialog programming , in which i am using Table Control  for user input (data is not coming from database table) . everything is going well till assignment of data to internal table but when
    control goes to PBO by any means like pressing ENTER etc. then data being washed out.
    PROCESS BEFORE OUTPUT.
      MODULE TC_CONTROL.
      LOOP AT it_data
             INTO wa_data
             WITH CONTROL tc_control
             CURSOR tc_control-current_line.
        MODULE tc_control_get_lines.
      ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT IT_DATA.
        CHAIN.
          FIELD WA_DATA-FREPS_N.
          FIELD wa_data-TOEPS_N.
          FIELD wa_data-PRCH_A.
          FIELD wa_data-SRVC_AMT .
          FIELD wa_data-ACCNT_C.
          FIELD wa_data-AMT_D.
          FIELD wa_data-NARR_X.
          FIELD wa_data-CRPRD_N.
          MODULE tc_control_modify ON CHAIN-REQUEST.
        ENDCHAIN.
      ENDLOOP.
    *Abap program
    MODULE TC_CONTROL OUTPUT.
    DESCRIBE TABLE it_data LINES tc_control-lines.
    ENDMODULE.                 " TC_CONTROL  OUTPUT
    CONTROLS: TC_CONTROL TYPE TABLEVIEW USING SCREEN 1000,
              TC_CONTROL1 TYPE TABLEVIEW USING SCREEN 1000.
    DATA:     G_TC_CONTROLS_LINES  LIKE SY-LOOPC,
              G_TC_CONTROLS_LINES1  LIKE SY-LOOPC.
    *&      Module  tc_control_get_lines  OUTPUT
          text
    MODULE tc_control_get_lines OUTPUT.
    g_tc_controls_lines = sy-loopc.
    move-corresponding it_data to wa_data.
    ENDMODULE.                 " tc_control_get_lines  OUTPUT
    MODULE tc_control_modify INPUT.
    move-corresponding wa_data to it_data.
    MODIFY it_data
        FROM wa_data
        INDEX tc_control-current_line.
    append it_data.
    clear it_data.
    ENDMODULE.                 " tc_control_modify  INPUT
    Please suggest me any clue.
    Thanks in advance
    vijay dwivedi

    Hi ,
    I have understood the problem.
    In your ABAP code replace all the occurrrences of wa_data  with the structurename.
    Use the TABLES keyword to declare the structure .That structure will be same as
    reference table of the table control .
    Here the structure is SPFLI.
    Check the bellow code , it will resolve the issue.
    ABAP code - -
    program  zsdn.
    tables spfli.  " Declare the structure
    data : it_data like table of spfli with header line,
    *wa_data TYPE spfli,  " commented
    w_i type i.
    *CONTROLS TC_CONTROL TYPE TABLEVIEW USING SCREEN 100.
    controls: tc_control type tableview using screen 1000,
    tc_control1 type tableview using screen 1000.
    data: g_tc_controls_lines like sy-loopc,
    g_tc_controls_lines1 like sy-loopc.
    module tc_control output.
      describe table it_data lines tc_control-lines.
    endmodule. " TC_CONTROL OUTPUT
    module tc_control_get_lines output.
      g_tc_controls_lines = sy-loopc.
      move-corresponding it_data to spfli.
    endmodule. " tc_control_get_lines OUTPUT
    module tc_control_modify input.
      move-corresponding spfli to it_data.
      modify it_data
      from spfli
      index tc_control-current_line.
      append it_data.
      clear it_data.
    endmodule. " tc_control_modify INPUT
    module status_0100 output.
      set pf-status 'STAT'.
    *  SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_0100  OUTPUT
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK' or 'EXIT' or 'CANCEL'.
          leave to screen 0.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Module  POPLATE_TABLE  OUTPUT
    *       text
    module poplate_table output.
      if it_data is initial.
        select * from spfli into table it_data.
      endif.
    endmodule.                 " POPLATE_TABLE  OUTPUT
    Screen code (Scr no 1000) - -
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE poplate_table.
      MODULE tc_control.
      LOOP AT it_data WITH CONTROL tc_control CURSOR w_i.
        MODULE tc_control_get_lines.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
      LOOP AT it_data.
        MODULE tc_control_modify ON CHAIN-REQUEST.
    *    ENDCHAIN.
      ENDLOOP.
    Regards
    Pinaki

  • Using CheckBox / Radio-Button Control in Dialog Program

    Dear Friends,
    Please let me know the way to use check-box / radio-button control in dialog programs. Where & how to define them & write the logic.
    If possible provide a small example.
    Regards,
    Alok.

    Hi,
    goto tcode abapdocu.. abap user dialogs - screens-processing screens you will get examples for all --pushbutt6ons radiobutton checkboxes everything
    <b>here is a sample code for you</b>
    PROGRAM demo_dynpro_check_radio .
    DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
          field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
          box TYPE c.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    CALL SCREEN 100.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'RADIO'.
          IF radio1 = 'X'.
            field1 = 'Selected!'.
            CLEAR: field2, field3.
          ELSEIF radio2 = 'X'.
            field2 = 'Selected!'.
            CLEAR: field1, field3.
          ELSEIF radio3 = 'X'.
            field3 = 'Selected!'.
            CLEAR: field1, field2.
          ENDIF.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    <b>flow logic:</b>
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
    regards,
    pankaj singh.
    <i><b>
    reward if helpful</b></i>

  • User Authorisations in Dialog Programming.

    Hi Friends,
    I have a small requirement, I want to create user authorisations in dialog programming.
    Actually client requirement is he want to enter absence details of each and every branch.
    For that i have created a cusom table and i  also i have developed a dialog program inorder to update the details
    and to retrive all the data i have created a report program also.
    Now the client requirement is he want user authorisations while updating the data through dialog programming, that means if a user loging in that particular branch he want to enter the absence details pertaining to that branch only, when he tries to enter the details of other employee pertaining to another branch an error should be raised.
    Actually in the client place they are using authrisation object as 'Z_WERKS'.  The basis person has created this and provided for me.
    Actually i have created an Authority check in module pool program.Here iam attaching my prog,
    Pls provide me the sample code if at all available.
    *& Include ZEMPTOP                                           Module pool
    PROGRAM  ZEMP.
    TABLES : ZABS,PA0001.
    DATA : WA_PA0001 LIKE PA0001,
           V_ANS.
    DATA: BEGIN OF Z_WERKS OCCURS 0,
            PERSA LIKE T500P-PERSA,
            NAME1 LIKE T500P-NAME1,
          END OF Z_WERKS.
    *&  Include           ZEMPI01
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'DISP'.
    SELECT SINGLE * FROM ZABS WHERE PERNR = ZABS-PERNR.
    IF SY-DBCNT <> 0.
    *MESSAGE I000(Z00) WITH 'Details of' ZABS-PERNR .
    else.
    MESSAGE I000(Z00) WITH 'No Details Available to Display'.
    ENDIF.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    LEAVE TO SCREEN 0.
    WHEN 'CLS'.
    CLEAR ZABS.
    WHEN 'INS'.
    INSERT ZABS .
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    IF SY-DBCNT <> 0.
    MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    'inserted successfully'.
    ENDIF.
    CLEAR ZABS.
    WHEN 'MOD'.
    UPDATE ZABS.
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    IF SY-DBCNT <> 0.
    MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    'Modified Successfully'.
    ENDIF.
    CLEAR ZABS.
    *WHEN 'DEL'.
    *CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
    EXPORTING
       TEXTLINE1           = 'ARE YOU SURE'
       TEXTLINE2           = 'YOU WANT TO DELETE'
       TITEL               = 'CONFIRMATION'
       START_COLUMN        = 25
       START_ROW           = 6
       DEFAULTOPTION       = 'N'
    IMPORTING
       ANSWER              = V_ANS.
    *IF V_ANS = 'J'.
    *DELETE ZABS.
    *IF SY-DBCNT <> 0.
    *MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    *'Deleted Successuflly'.
    *ELSE.
    *MESSAGE I000(Z00) with 'No Record to Delete'.
    ENDIF.
    *ENDIF.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  GET_REC  INPUT
          text
    MODULE GET_REC INPUT.
    SELECT SINGLE * FROM PA0001 INTO WA_PA0001
             WHERE PERNR = ZABS-PERNR.
    MOVE: WA_PA0001-PERNR TO ZABS-PERNR,
          WA_PA0001-ENAME TO ZABS-ENAME,
          WA_PA0001-GSBER TO ZABS-GSBER,
          WA_PA0001-WERKS TO ZABS-WERKS.
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    ENDMODULE.                 " GET_REC  INPUT
    *&      Module  CHECK_AUTH_WERKS  INPUT
          text
    MODULE CHECK_AUTH_WERKS INPUT.
    *SELECT PERSA INTO TABLE _WERKS FROM T500P
            WHERE  PERSA = ZABS-WERKS.
    AUTHORITY-CHECK OBJECT 'Z_WERKS'
    ID 'PERSA' FIELD Z_WERKS-PERSA.

    You need to test the sy-subrc after the authority check - that will indicate whether the user has the authorisation or not.. you also often include the activity being tested e.g. generally 03 = Display, 02 = Update etc
    AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
      ID 'ACTVT'    FIELD '03'
      ID 'CUSTTYPE' FIELD 'B'.
    IF not SY-SUBRC is initial.
      MESSAGE E...   "put your exception here...
    ENDIF.
    see [Programming Authorization Checks  |http://help.sap.com/saphelp_nw04/helpdata/en/52/6712ac439b11d1896f0000e8322d00/content.htm] for more info.
    Jonathan

  • Performance issue in abap program

    hi,
    how can we improve the performance of  abap program

    hi,
    read the follwing links
    ABAP provides few tools to analyse the perfomance of the objects, which was developed by us.
    Run time analysis transaction SE30
    This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
    SQL Trace transaction ST05
    by using this tool we can analyse the perfomance issues related to DATABASE calls.
    Perfomance Techniques for improve the perfomance of the object.
    1) ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
    2) Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out.
    3) Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
    4) Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
    5) Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
    6) Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space.
    Use as many table keys as possible in the WHERE part of your select statements.
    7)Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
    8) Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
    9) Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
    10) Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
    11) Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
    12) If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
    13) Know how to use the 'collect' command. It can be very efficient.
    14) Use the SELECT SINGLE command whenever possible.
    15) Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
    Some tips:
    1) Use joins where possible as redundant data is not fetched.
    2) Use select single where ever possible.
    3) Calling methods of a global class is faster than calling function modules.
    4) Use constants instead of literals
    5) Use WHILE instead of a DO-EXIT-ENDDO.
    6) Unnecessary MOVEs should be avoided by using the explicit work area operations
    see the follwing links for a brief insifght into performance tuning,
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00/frameset.htm
    regards
    Rohan

  • Dynamic header text in table control - Dialog programming

    Hi All,
    I have a table control on one of my dialog screens.  I need to dynamically change the column header texts on this control in my PBO.  Does anyone know how to do this?  I have found all kinds of ways to modify the other characteristics of the fields at run time in the PBO (active, input/output, invisible, etc.) - but not to change the header text!  Any help is appreciated.
    thanks,
    Matt

    Hi Hymavathi,
    I appreciate your help!  This didn't solve the issue, however,...I have used the method you'd mentioned before (many times) for setting it inside the loop at screen:
    %_<screenname>_%_APP_%-TEXT = <text something>.
    - but only in ABAP reports.  It doesn't seem to recogize it (the table control column header text) within a dialog program.  I keep getting a compile error. (saying that the %_<screenname>_%_APP_%-TEXT doesn't exist.
    I tried the suggestion that you stated below (from lateesh) - yet it only let me place i/o field in title text area (not the column header text).  Am still searching...

  • Select-Options in dialog program

    Hi there,
    I'm using a selection-screen in a dialog program, I declared it in the TOP.
    Selection-screens
    SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
    parameters: p_lifnr type lfa1-lifnr  obligatory ,
                p_werks type t001w-werks obligatory .
    SELECT-OPTIONS:
      s_licha FOR zbrtconsig-licha.
    SELECTION-SCREEN END OF SCREEN 101.
    I have to use the event at selection-screen on value-request for s_licha-low, and I need the values from the fields p_lifnr and p_werks. the problem is:
    If I only fill the fields p_lifnr, p_werks and click on F4 for s_licha, the values of p_lifnr and p_werks are not updated, they are empty. Only wether I do an Enter this fields is updated.
    Thanks,
    Alexandre Nogueira

    Hi,
    i am not clear about your problem, please expalin it clearly.
    use FM : DYNP_VALUES_UPDATE to update screen fields.
    use FM : DYNP_VALUES_READ to read screen fields.
    use SET /GET Parameter id's to set parameters
    this FM will update the screen fields before to PBO event.
    check this link for sample code :
    Re: Issue Related to Module pool
    Regards
    Appana

  • How to Execuate Dialog program in backgroud

    Hi,
       I am doing with dialog program which going to save values in database using bapi, there is two buttons available in my program one is save and another one is background, when the user clicks save, values will be saved in online, suppose if the user clicks background, my dialog program should be run in background to store the values in database.
      I appreciate if experts provide tips to overcome this issue.

    Hello,
    Submit the same program in background mode and pass all the required parameters
    *part for background processing
    DATA: lv_job_name         LIKE tbtco-jobname,
    lv_job_nr           LIKE tbtco-jobcount,
    lv_job_released     TYPE c,
    lv_job_start_sofort TYPE c,
    lv_print_parameters TYPE pri_params.
    lv_job_name = 'ZPGM_NAME'. " your pgm name goes here
    * used to avoid spaces in the display
    DATA: lv_job_name_string TYPE string.
    lv_job_name_string = lv_job_name.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = lv_job_name
        IMPORTING
          jobcount         = lv_job_nr
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF syst-subrc = 0.
    *submit job with all the selection screen params...
        SUBMIT (lv_job_name)
            WITH applfile = applfile  " parameters start here
            WITH p_lines = p_lines
            WITH rfc_dest = rfcdest
            WITH p_selmtd = lv_selmtd
            WITH px_shsim = px_shsim
            WITH px_sherr = px_sherr " parameters end here
            USER syst-uname
           VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
        IF sy-subrc = 0.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = lv_job_nr
              jobname              = lv_job_name
              strtimmed            = 'X'
            IMPORTING
              job_was_released     = lv_job_released
            EXCEPTIONS
              cant_start_immediate = 1
              invalid_startdate    = 2
              jobname_missing      = 3
              job_close_failed     = 4
              job_nosteps          = 5
              job_notex            = 6
              lock_failed          = 7
              OTHERS               = 8.
          IF syst-subrc <> 0.
            MESSAGE i162(00) WITH
            'An error occured while closing the background job.'.
            STOP.
          ENDIF.
        ENDIF.
      ENDIF.
      SKIP 1.
      WRITE: / 'Background process', lv_job_name_string , 'called successfully' NO-GAP.
      WRITE: / 'You can check the job in transaction SM37'.

  • Differences between ABAP Programming and Dialog Programming

    Can any one explain me the Differences between ABAP Programming and Dialog Programming

    Hi,
    ABAP PROGRAMING:
    An ABAP program consists of individual ABAP statements. Each statement begins with a keyword and ends with a period.
    PROGRAM FIRST_PROGRAM.
    WRITE 'My First Program'.
    This example contains two statements, one on each line. The keywords are PROGRAM and WRITE. The program displays a list on the screen. In this case, the list consists of the line "My First Program".
    The keyword determines the category of the statement. For an overview of the different categories, refer to ABAP Statements.
    You can execute different parts of programs conditionally or in loops using the standard keywords IF, CASE, DO, and WHILE.
    When controlling the flow of an ABAP program, remember that the structure of the program is made up of processing blocks that cannot be nested. This section describes how to control the flow of a program within a processing block. The keywords covered here do not allow you to branch outside the processing block in which you use them. You can regard this as internal control of an ABAP program, as opposed to the external control provided by events in the ABAP runtime environment.
    To control the internal flow of a processing block, you can use control structures to divide it up into smaller statement blocks according to the principles of structured programming.
    DIALOG PROGRAMING:
    This is a classical programming method that is based on dynpros and dialog transactions.
    Classic Application Programming
    Separating the application layer from the presentation layer means that when you run an ABAP application program requiring user interaction, control of the program is continually passed backwards and forwards between these layers. While a screen is ready for input, the corresponding SAP GUI of the presentation layer is active. During this time, the application layer is not active for the application program. Therefore, the ABAP application servers are free for other tasks. Once the user has entered data on the screen, program control passes back to the application layer. Now, the presentation layer is inactive. The SAP GUI is still visible to the user during this time, and it is still displaying the screen, but it cannot accept user input. The SAP GUI does not become active again until the application program has called a new screen and sent it to the presentation server.
    Consequently, if you use this method, you need to divide dialog programs into single dialog steps, with each of these steps comprising the programming logic between two successive screens.
    REGARDS,
    VASAVI.
    KINDLY REWARD IF HELPFUL.

  • Beginning Dialog Programming

    Dear Friends,
    I want to begin with dialog programming in ABAP. So, please tell me how to start & where to look out for the good examples. Please tell me about the examples in IDES also.
    Bye,
    Nishant

    Nishant,
    I found the book 'ABAP/4 Programming the SAP R/3 System' critical to my success when I started learning Dialog Programming 2 years ago.
    This book covers other issues as well, but there are a 120 pages devoted to the basics of Dialog Programming.
    It also covers ABAP Objects, reports, interactive reports, and building all types of dictionary objects.
    http://tinyurl.com/9a6t4
    Make sure to get 2nd Edition.
    Hope this helps,
    Brett

  • Hi everybody,need help in Dialog Programming

    Hi everybody,
              I am trying to learn Dialog programming , i am having materials to read, which includes syntax, i want a guidance to start the programming practically . Could anyone help me go through this, step by step. I know the T-code for dialog programming is SE80, what should be the next step to do some simple programs to start with, it would be great if someone help me with a small programming example.
    Thanks,
    Ranjani.

    Hello,
    Checkout this site <b>http://linuxgazette.net/101/sunil.html</b>.Hope it works.
    1) <a href="http://www.stata.com/support/faqs/lang/db-intro/db2.html">http://www.stata.com/support/faqs/lang/db-intro/db2.html</a>
    2) <a href="http://www.stata.com/support/faqs/lang/db-intro/db3.html">http://www.stata.com/support/faqs/lang/db-intro/db3.html</a>
    All the best......

  • What is difference between report programming and dialog programming?

    hi,
    what is difference between report programming and dialog programming? plz provide some example code
    bye

    ABAP programming
    Basically reports are used to read database and represent the results in lists.
    Reports are collections of processing blocks that the system calls depending on events.
    We can use reports to evaluate data from database tables.
    Reports are stand alone programs and controlled by events.
    A report itself never creates events
    steps in report:
    Processing the selection screen
    Reading the database
    Evaluating the data and creating lists
    Outputting a list.
    1st u write simple logics, after that u can enhance the code as step by step.
    http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/index.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
    http://www.sapdev.co.uk/reporting/reportinghome.htm
    Dialog Programming
    Structure of a Dialog Program
    A dialog program consists of the following basic components:
    Screens (dynpros)
    Each dialog in an SAP system is controlled by dynpros. A dynpro (DYnamic PROgram) consists of a screen and its flow logic and controls exactly one dialog step. The flow logic determines which processing takes place before displaying the screen (PBO-Process Before Output) and after receiving the entries the user made on the screen (PAI-Process After Input).
    The screen layout fixed in the Screen Painter determines the positions of input/output fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
    ABAP/4 module pool
    Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
    All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
    Check this link for basics.
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    Check this link for Dialog Programming/Table Control
    http://www.planetsap.com/Tips_and_Tricks.htm#dialog
    Check this SAP Help for Dialog Program doc.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    Check this SAP Help link for Subscreens.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
    Check this link for subscreen demo program.
    http://abapcode.blogspot.com/2007/05/demo-program-to-create-subscreen-in.html
    Also check this link too.
    http://abapcode.blogspot.com/2007/06/dialog-programming-faq.html
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld004.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ccf35c111d1829f0000e829fbfe/frameset.htm
    http://abapprogramming.blogspot.com/

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • How to call a Dialog Program from another Dialog Program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    1. Insted of creating 2 different Dialog program. It's good to create as many screens as you want in same module pool program. Any way you can use the different TCODE for each screen.
    2. Another and The best way is to create a function group and then inside function group use the function 2 module... In the function group define a global variable which will be present for both the function group if they are getting executed in sequence. and inside the Function Module call the screens using command " call screen <screenno>".
    3. You can use set / get parameter to pass values of a field between two dynpro program.

Maybe you are looking for