BW ABAP in routines

Dear All,
I would need some ABAP help in a BW transformation routine. My ABAP knowledge is limited.
I have a source field called YQM_MASCHINE with various values, for example: CONE114-M014S002 and TUBE-M015S001. There can be many other different values, of course. The requirement is to fill 2  target fields (let us call them ABC and XYZ) from the source field YQM_MASCHINE field using the following 2 rules:
1) FIELD ABC = YQM_MASCHINE up to dash " - ", so in our example it would be CONE114 and TUBE. The dash and the strings after the dash need to be deleted.
The difficulty for me is that we do know where the dash falls in the character string so I cannot use RESULT = SOURCE_FIELDS-YQM_MASCHINE(n), because "n" can be take various values.
2) FIELD XYZ = YQM_MASCHINE without the last 4 characters, that means CONE114-M014 and TUBE-M015. So the values S002 and S001 need to be deleted from the original YQM_MASCHINE value. Again, I do not know how long the character string is.
A workaround for the first issue would be to use IF, ELSEIF, n times, until I find the dash...it is not a really nice solution, I guess.
l_mach = SOURCE_FIELDS-YQM_MASCHINE.
    IF l_mach(4) = '-'.
      RESULT = l_mach(3).
    ELSEIF l_mach(5) = '-'.
      RESULT = l_mach(4).
    ELSEIF l_mach(6) = '-'.
      RESULT = l_mach(5).
    ELSEIF l_mach(7) = '-'.
      RESULT = l_mach(6).
    ELSEIF l_mach(8) = '-'.
      RESULT = l_mach(7).
    ELSEIF l_mach(9) = '-'.
      RESULT = l_mach(8).
    ELSE.
          ENDIF.
As mentioned, my ABAP is quite poor. There must be a way to find a dash in a string without doing many IF, ELSE...
For the rule number 2 I have no solution in my "dictionary".
Many thanks for your help.
Kind regards,
Csaba

Hi Amandeep,
thanks for your idea. The split works fine for the first rule, indeed. I had to include a check on the dash, since there are values with no dash, as well.
How would you do the 2nd rule where the last 4 characters need to be deleted? That is slightly different because the split is not done after the dash.
Many thanks,
Csaba
Rule 1 - okay
l_mach = SOURCE_FIELDS-YQM_MASCHINE.
    SEARCH l_mach FOR '-'.
    WRITE: / SY-SUBRC UNDER 'SY-SUBRC'.
    IF SY-SUBRC = 0.
      SPLIT SOURCE_FIELDS-YQM_MASCHINE AT '-' INTO s1 s2.
      RESULT = s1.

Similar Messages

  • How to Debug  ABAP/4 routine in Dynamic Selection?

    Problem:
            I am not able to debug the ABAP/4 routine in data dynamic selection.
    Analysis:
            I typed /H on  transaction command prompt. I entered to ABAP/4 debug mode.
    Then I am not  able to debug my routine. Give me solution for this problem?

    Hi Surya,
    If you want to debug the routines in transformation
    GOTO Transformation you need to debug -- seelct the tranformation id
    To debug these routines we need to go to the generated program of the Transformations in two ways:
    We can get the Program ID for the Transformation ID (6HkDSDsHJNQO0VTU3HK01MH7) from table RSTRAN.
    You can get the program id from the table... append GP to the program id you will get the report program for transformations.
    Now goto Tcode : se38 enter the program name and set the break points.
    On going with display we will be to the ABAP editor of the Report Program.
    The other way of getting to this program is from the Transformations itself.
    Go to Extras -->Display Generated Program. It directly takes us to the ABAP editor of the Report Program.
    Set a break point at the code you want to debug, i.e. at your selections at start routine and at your update
    routine.
    Now after setting the Break points run the DTP in the debug mode.(Select the Processing Mode Serially in the Dialog process (for Debugging)).
    If you are on BW 3.x
    /people/pavan.bayyapu/blog/2006/09/06/debugging-data-upload-in-bw
    Regards
    KP
    Edited by: prashanthk on Jul 25, 2010 10:05 AM

  • ABAP Update Routine

    Hi All,
    I am new in SAP BW and I am trying to learn more on the ABAP Routine in the Update Rule.
    Questions:
    1. The program name is always UPDATE_ROUTINE?
    2. There will always be a default subroutine "compute_data_field"?
    3. What do you mean by MONITOR STRUCTURE RSMONITOR?
    4. Is COMM_STRUCTURE a keyword in ABAP?
    5. Is it possible to give me a details of each MONITOR STRUCTURE part of the code?
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS8ZD2C_O05
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/VZD2C_C05T-/BIC/ZABLSTCST
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine
      RESULT = .
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.

    Found out through self-study

  • ABAP HR ROUTINE OR EXIT

    I want to fetch the data from Infotype 581 from field of Rent paid  --- ( Field : RTAMT Table : Q0581 )
    and want to calcualte as per the eligibility criteria and the result should be displayed in the Infotype 585 ---
    ( Field : PCNTR Table : Q0585 ) in Proposed contribution field .
             I think now the requirement is clear. I am new to ABAP - HR. Please let me know how this is done.
    H R Routine or Exitsap abap
    Reply to all
    Forward
    Reply by chat
    Filter messages like this
    Print
    Add to Contacts list
    Delete this message
    Report phishing
    Report not phishing
    Show original
    Message text garbled?
    Why is this spam/nonspam?
    KB shivakumar     
    Hi satyesh, Can you please tell me where do I write a routine for H R Module....
    Nov 26 (1 day ago)
    talari satyesh     
    Hi Shiva, Do one thing...as i mentioned in my previous mail. After u execute ...
    10:45 AM (10 hours ago)
    KB shivakumar     
    Hi Sir, I will try with that option thanks very much. Shivakumar K B 91988692...
    10:59 AM (10 hours ago)
    KB shivakumar to talari
    show details 8:35 PM (1 hour ago)
    Reply
    Hi Satish,
    One of my friend told me that problem can be solved using dynamic actions
    Goto Tcode SM30
    and table V_t588Z Go that Table and code it.
    I have to fetch the field based on some conditions and .
    The conditions are
    1. Actual Rent Paid   For Ex 5000*12 = 60000
    2. Actual Rent Paid  - 10% of Basic Salary
    for ex 5000*12 = 96000
    60000 - 10% of Salary
    If salary is 10000/ month
    10000*12  = 120000
    10% of it (10/ 100)*120000
    = 12000
    So 60000 - 12000 = 84000
    3. 40% of Salary
    For ex 40*10000 = 40000
    4. 50% of Salary = 60000
    5. Maximum Limit is 24000
           The value which is the lowest of these values have ro be displayed will be the Propriter's Contribution.
          I dont know what to code there in SM30.
    Or is the approach Right.I dont know anything about it. Please let me know how it is done.
    Shivakumar K B
    919886920258

    Hi,
    You can do this by implementing User Exit PBAS0002. You need to write code in FM EXIT_SAPFPS0M_002.
    you can write something like:
      IF innnn-infty = '0581' AND ( ipsyst-ioper = c_ins OR
            ipsyst-ioper = c_mod OR ipsyst-ioper = c_cop ).
    do calculation...
    upload data in 585 by HR_INFOTYPE_OPERATION.
    Endif.
    regards,
    Dharitree

  • ABAP Trans routine help

    Hi
    I'm writing below abap routine in transrules to bring the plant from ZODS_01 active table :
      SELECT SINGLE PLANT INTO ZPLANT
      FROM /BIC/AZODS_01
      WHERE DOC_NUMBER = TRAN_STRUCTURE-VBELN
      AND /bic/ZCODE = 'SE'.
    Code is working if there is only one record exist in /BIC/AZODS_01 with ZCODE = SE. But if there is more records exist with different codes including SE, its not brining the SE value. Do I need to remove the Single from SELECT statement or do I need to loop this in start rotuine to loop through every record until it finds SE ?
    Please advice.

    Hello
          Writing a SELECT SINGLE is not good if we want a better Code Performance , as for each record it hits the data base , which inturn will increase the load time . rather its suggested that Do one select with For all entries of data package & subsequently at INfo Object level have READ statement . some time like below
          SELECT
         PLANT
            FROM /bic/a<DSO Name>
            INTO TABLE Internal table
             FOR ALL ENTRIES IN source_package
           WHERE doc_number = source_packagedoc_number
    & read would like below
        READ TABLE Internal table  INTO wa_doc
             WITH TABLE KEY doc_number = SOURCE_FIELDS-doc_number
    If this suggestion looks good , & need more code help do let me know
    Thanks
    Vivek

  • ABAP CODE ROUTINE

    i want to calculate formula basing on the below information.
    ZGR= GOODS RECEIPT STATUS.
    below is the thing which i want.
    let me know what codei need to write.
    DSOTABLE NAME-ZT0007
    i want GOODS RECEIPT STATUS.(it should finally give us goods receipt status)
    A (not yet recepited)
    B (Partially Recepited)
    C (Completely Recepited)
    what type of infoobject i need to create for Goods receipt status.
    If 0GR_RE_IND='X'
    read the internal table of DSO-ZT0007 and sum the total goods receipt quantity (GR QTY) for the purchase order schedule line item (PO receipt type=GR)
    IF GR QTY=0
    GRS=A
    else if GR QTY<oorder_quan
    GRS=B
    ELSE
    GOODS RECEIPT='C'
    end if.
    else.
    Goods Receipt=' '
    End if.
    how can i write this in abap routine for charcterstic code..
    thanks

    Hi,
    try the following :
        CALL FUNCTION 'FIMA_VTBKOND_CALC_DATES'
          EXPORTING
            i_date   = source_fields-/bic/ZSTRT_DTE
            i_months = '6'
          IMPORTING
            e_date   = result.
    hope it helps...
    regards,
    Raju

  • ABAP Start Routine

    Hello,
    I am writing a Start Routine in my update rules from an ODS into another ODS.  My start routine is basically just restricting some data from being updated into my data target.  I am restricting based on 0VYPTE = 20.  That is, if a records has 0VTYPE = 20 I am deleting it from the data_package.  If I debug through the program, it works correctly with one record but when I throw in about 120K records it doesn't work. Can someone please have a look and tell me what is wrong here?
    LOOP AT DATA_PACKAGE.
         <b>IF DATA_PACKAGE-VTYPE NE 10.</b>
           DELETE DATA_PACKAGE.
             CONTINUE.
         ELSE.
           IF DATA_PACKAGE-/BIC/CASES NE 'CS'.
                 PERFORM load_mrscube_tables USING DATA_PACKAGE-SOURSYSTEM.
                 PERFORM BASEUNIT_CONVERT tables
                                              MONITOR
                                     using    DATA_PACKAGE-MATERIAL
                                              DATA_PACKAGE-SOURSYSTEM
                                              DATA_PACKAGE-/BIC/CASES
                                              'CS'
                                              DATA_PACKAGE-/BIC/CASES_REV
                                     changing
                                              quant_out.
                     EXIT.
                 EXIT.
         modify DATA_PACKAGE.
           ENDIF.
         ENDIF.
    ENDLOOP.

    Hi Nyrvole,
       Try to change the code this way and check(debug).
    DELETE DATA_PACKAGE WHERE VTYPE NE 10.
    LOOP AT DATA_PACKAGE.
    IF DATA_PACKAGE-/BIC/CASES NE 'CS'.
    PERFORM load_mrscube_tables USING DATA_PACKAGE-SOURSYSTEM.
    PERFORM BASEUNIT_CONVERT tables
    MONITOR
    using DATA_PACKAGE-MATERIAL
    DATA_PACKAGE-SOURSYSTEM
    DATA_PACKAGE-/BIC/CASES
    'CS'
    DATA_PACKAGE-/BIC/CASES_REV
    changing
    quant_out.
    EXIT. -- WHY THIS EXIT FOR...??
    EXIT. -- WHY THIS EXIT FOR...??
    modify DATA_PACKAGE. -- ARE YOU CHANGING ANY RECORDS..??
    ENDIF.
    ENDLOOP.
    Put break-point after end loop and dugug and see the no of records.
    Hope it Helps
    Srini

  • ABAP Conversion Routine

    HI,
    I want to create Conversion Routine andI know Coversion Routine was linked with Domain,
    Domain that I want to create Coversion Routine was used in serveral tables.
    I want to run Coversion Routine at specific table and I doesn't want to change domain name.
    Any ideas.
    Regards, Arnold.

    Thanks for Comments but I have basic knowledge for Converion Routine.
    My question si that Can we run Conversion Routine at Specific Table ?
    For example, we created Conversion Routine "A111" for domain "D111".
    Domain "D111" was used at table ZT001, ZT002, ZT003.
    I want to run Conversion Routine "A111"  at only table ZT001 because table ZT002, ZT003 has
    differenent meaning for domain "D111".
    Any Ideas ?
    Regards, Arnold.

  • BW-ABAP start routine code logic

    Hello friends,
    I am writing start rotine code between ODS and InfoCube.I need your help determining the right logic.
    Requirement is as follows.
    1. Create one database table to store GL account ranges.
    2. This table will have multiple ranges of GL account.
    3. Write a code such a way that only GL acc. range in this table is included and  
        all the other records containing GL acc. outside this range should be deleted.
    Here is the logic which I have developed.
    Please help me with your suggestion.
    Message was edited by:
            John Anderson

    Hi John,
       I did not check the syntax of this program and I am very bad at remembering the syntax. Let me know if you face any problem with the code I am supplying.
    Code removed ....
    Best Regards,
    Kazmi
    Message was edited by:
            Kazmi

  • Append Duplicate entries in Start Routine through ABAP code

    Hi Experts,
    I need to write an ABAP code in the start routine for the following conditions.
    For every record in fiscal period (FISCPER) which has non u2013quarter months eg if Jan/Feb ie (001.2007 or 002.2007) I need to create an additional duplicate record which keeps all the other values same but negates the key figures and replaces the month by a quarter ending month
    Eg: if my records are
    FISCPER   COMP_CODE    GLACCT       BALANCE
    001.2007     1000                     6789090       70
    002.2007      1000                    6789090       80
    I need to create/append duplicate entries by negating the Balance value and replacing the Fiscper with 003.2007
    FISCPER COMP_CODE   GLACCT   BALANCE
    003.2007    1000                6789090    -70
    003.2007    1000                6789090    - 80
    Hence the entire structure should now look like:
    001.2007       1000        6789090         70
    002.2007       1000        6789090         80
    003.2007       1000        6789090        -70
    003.2007       1000        6789090       - 80
    Similarly, I need to append duplicate entries for all non quarter ending months and replacing the Fiscper with the quarter ending month and also negate the Key figure value.
    Hence, similarly,
    001.2007        1000            6789090             70
    002.2007        1000            6789090             80
    003.2007        1000            6789090             -70
    003.2007        1000            6789090            - 80
    004.2007        1000            6789090              30
    005.2007        1000            6789090              90
    006.2007        1000            6789090             -30
    006.2007        1000            6789090             -90
    I am very new to ABAP, can someone please provide the ABAP start routine code for this..
    Regards,
    Dipali

    Hi,
        Check the below code. Paste it in yr Start Routine.
    '*'Begin of code
    DATA : wa_Data_Package LIKE Data_Package.
    DATA : t_Data_Package LIKE Data_Package.
    DATA : wa_temp LIKE Data_Package-BALANCE.
    Loop at Data_Package into wa_Data_Package.
    IF ( wa_Data_Package-FISCPER EQ 001/2007 ) or
         ( wa_Data_Package-FISCPER EQ 002/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 003/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 004/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 005/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 006/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 007/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 008/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 009/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ELSEIF ( wa_Data_Package-FISCPER EQ 010/2007 ) or
                 ( wa_Data_Package-FISCPER EQ 011/2007 ).
      wa_temp = wa_Data_Package-BALANCE.
      t_Data_Package-FISCPER = 012/2007.
      t_Data_Package-BALANCE = -wa_temp.
      Clear : wa_temp.
    ENDIF.
    APPEND t_Data_Package to Data_Package
    Endloop.
    '*'End of code
    Regards,
    Balaji V

  • BI end routine at transformation to populate info object by vlookup attribu

    Hi ,
    I am APO consultant working in Bi routines and I have the follwoing situation and need some guidance in ABAP code (routine) .
    We sales info from markets as flat filea snd lod them into cubes. One of the filed is file is External sales Group: ZEXSGRP. This is an attribute or Sales Group info object ZSLSGRP.
    We get external sales group populated in file when we upload the file into cube -  I  want to use end routine to vlook up the  info infoobject table ZSLSGRP - all the external sales groups and use the matching value to write Sales Group (ZSLSGRP).Example  if ZSLSGRP  is NAM and it attribute is  ZEXSGRP  and has value N0000032. The file gets value N0000032 so the end routine should look all attribute of all infoobject ZSLSGRP and match the value and populate in example above it populates NAM.
    Hope i am clear - can any help with this.
    thaks
    Varma

    Replace your select statement ,
    SELECT *
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
    SELECT    /BIC/PZF31SALOFF  comp_code
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    Remove the line below , this is not required
    MODIFY it_tab4 FROM wa_tab4.

  • Form - Perform and ABAP coding

    Hi:
    I have a requirement to get vendor address from database and print on the form. I could print only one field only Name1, but not details like Street or country Etc are not getting printed. Even if we pass multiple variables as input and putput variables using perform of form, I think we need to declare only one input as INTTAB  STRUCTURE ITCSY and one out put variable as OUTTAB  STRUCTURE ITCSY in the ABAP program. In the program I am using Index option like 1, 2 and modifying details of OUTTAB. Is it correct?.
    Still I am unable to print complete address on the form.
    For this I am unsing Perfom option in the form.
    Can you please help in the following:
    1) Can I pass one value vendor from form using perform and get back a structure from ABAP program?.
    2) I am using following:
             DEFINE &VENDOR_NAME& = ' '
             DEFINE &VENDOR_STREET& = ' '
             PERFORM GET_DATA IN PROGRAM Z_TEST
                       USING &VENDOR_NO&
                       CHANGING &VENDOR_NAME&
                       CHANGING &VENDOR_STREET&
             ENDPERFORM.
    For Printing I am using inthe form
                        &VENDOR_NAME&
                        &VENDOR_STREET&
    In the ABAP program I am using
    FORM GET_DATA TABLES INTTAB  STRUCTURE ITCSY
                         OUTTAB1 STRUCTURE ITCSY.
      IF SY-SUBRC EQ 0.
        SELECT SINGLE NAME1 STR_SUPPL1
           FROM ADRC
           INTO (V_NAME1,V_STR_SUPPL1)
           WHERE ADDRNUMBER = V_ADRNR.
        IF SY-SUBRC EQ 0.
    *- Name1
          READ TABLE OUTTAB1 INDEX 1.
          MOVE V_NAME1 TO OUTTAB1-VALUE.
          MODIFY OUTTAB1 INDEX SY-TABIX.
    *- Street
          READ TABLE OUTTAB1 INDEX 2.
          MOVE V_STR_SUPPL1 TO OUTTAB1-VALUE.
          MODIFY OUTTAB1 INDEX SY-TABIX.
      ENDIF.
    Can you please check above code and let me know if I am doing mistake anywhere?..like passing variables, printing variables on the form and ABAP sub-routine etc.
    Please do not copye again same code what is find in SAP ABAP help.
    Thanks in advance for your help.
    Thanks,
    Rama

    Naren:
    Your code did not work...
    Sorry I did not paste my complete code(when I posted message )as too much code might be confusing. Please find my code below:
    FORM GET_DATA TABLES INTTAB  STRUCTURE ITCSY
                         OUTTAB1 STRUCTURE ITCSY.
      DATA: V_ADRNR          LIKE LFA1-ADRNR,
                V_NAME1          LIKE ADRC-NAME1,
                V_STR_SUPPL1 LIKE ADRC-STR_SUPPL1,
                V_LIFNR             LIKE LFA1-LIFNR.
      READ TABLE INTTAB INDEX 1.
      V_LIFNR =  INTTAB-VALUE.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = V_LIFNR
        IMPORTING
          OUTPUT = V_LIFNR.
      SELECT SINGLE ADRNR
        INTO V_ADRNR
        FROM LFA1
         WHERE LIFNR = V_LIFNR.
      IF SY-SUBRC EQ 0.
        SELECT SINGLE NAME1 STR_SUPPL1
           FROM ADRC
           INTO (V_NAME1,V_STR_SUPPL1)
           WHERE ADDRNUMBER = V_ADRNR.
        IF SY-SUBRC EQ 0.
    *- Name1
          READ TABLE OUTTAB1 INDEX 1.
          MOVE V_NAME1 TO OUTTAB1-VALUE.
          MODIFY OUTTAB1 INDEX SY-TABIX.
    *- Name1
          READ TABLE OUTTAB1 INDEX 2.
          MOVE V_STR_SUPPL1 TO OUTTAB1-VALUE.
          APPEND OUTTAB1.
        ELSE.
          READ TABLE OUTTAB1 INDEX 1.
          MOVE 'NO NAME' TO OUTTAB1-VALUE.
          MODIFY OUTTAB1 INDEX SY-TABIX.
        ENDIF.
      ENDIF.
    ENDFORM.
    I am not sure where the mistake can be in the SAP-Form or in the ABAP Subroutine code....
    Thanks,
    Rama

  • ABAP program to neutralize  0Unit value and 0quantity value

    Hi all,
    I'm not expert in ABAP, and i would like implement a small abap program (routine)in my cube.
    I would like neutralize the 0UNIT value and 0QUANTITY value only when 0VTYPE = 1 or 2 :
    <b>in other words, if 0vtype = 1 or 4 then 0unit = space and 0quantity = 0
    b]
    Can you tell me please <b>how and where</b> write the ABAP program please ?
    Message was edited by:
            Pontoise Pontoise
    Message was edited by:
            Pontoise Pontoise

    Hi,
    I amnt able to understand your requirement. But the code for which you asked is simple.
    If 0vtype = 1 or 0vtype = ' '.
    0unit = space.
    0quantity = 0.
    endif.
    Regards
    Aneesh.

  • ABAP Module pool programming

    Hi all  plz any one send me the doc  for  Module pool programmiing to learn on my own
    thanks & regards
    vamsin

    Hi,
    This is the material find the attachment.
    hi,
    Pool table
    A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.
    Table Pool
    Database table in the database that contains the data of several pool tables.
    Cluster Table
    Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.
    Table Cluster
    Database table in the database that contains the data of several cluster tables.
    Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM
    P.Naganjana  ReddyDAY-4 CONTENTS
    SCREEN PAINTER
         &#56256;&#56510;&#61472;
    Introduction to Dialog Programming
         &#56256;&#56510;&#61472;
    Transactions
    &#61472;Screens (dynpros)
    ABAP/4 module pool
    Transferring Field Data
    Field Attributes
    Error Dialogs
    Data Consistency
    Dynpro
    Layout
         &#56256;&#56510;&#61472;
    Exercise
    TABLE CONTROL
         &#56256;&#56510;&#61472;
    Functional scope
         &#56256;&#56510;&#61472;
    Programming
         &#56256;&#56510;&#61472;
    Attributes
         &#56256;&#56510;&#61472;
    EXERCISE
    TABSTRIP CONTROLS
         &#56256;&#56510;&#61472;
    Defining the Tabstrip Control Area and Tab Titles
         &#56256;&#56510;&#61472;
    Assigning a Subscreen Area to a Tab Title
         &#56256;&#56510;&#61472;
    Paging in the SAPgui
         &#56256;&#56510;&#61472;
    Programming the Flow Logic
         &#56256;&#56510;&#61472;
    EXERCISE
    P.Naganjana  Reddy
    SCREEN WITH FIELDS
    Introduction to Dialog Programming
    Transactions
    A transaction is a program that conducts a dialog with the user. In a typical dialog, the
    system displays a screen on which the user can enter or request information. As a reaction on
    the the user input or request, the program executes the appropriate actions: it branches to the
    next screen, displays an output, or changes the database.
    Example
    A travel agent wants to book a flight. The agent enters the corresponding data on the
    screen. The system either confirms the desired request, that is, the agent can book the flight
    and the customer travels on the desired day on the reserved seat to the chosen destination,
    or the system displays the information that the flight is already booked up.
    To fulfil such requirements, a dialog program must offer:
    _&#61472;a user-friendly user interface
    _&#61472;format and consistency checks for the data entered by the user
    _&#61472;easy correction of input errors
    _&#61472;access to data by storing it in the database.
    ABAP/4 offers a variety of tools and language elements to meet the requirements stated
    above in the dialog programs.
    Structure of a Dialog Program
    A dialog program consists of the following basic components: 
    P.Naganjana  Reddy
    &#61472;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.
    Transferring Field Data
    How do I display fields known in an ABAP/4 module on the screen? How do I transfer
    user entries on the screen to the module? In contrast to report programming, you cannot write field data to the screen using the WRITE statement. The system instead transfers data by comparing screen field names with ABAP/4 variable names. If both names are the same, it transfers screen field values to ABAP/4 program fields and vice versa. This happens immediately before and immediately after displaying the screen.
    Field Attributes
    For all screen fields of a dynpro, field attributes are defined in the Screen Painter. If a
    field name in the screen corresponds to the name of an ABAP/4 Dictionary field, the system automatically establishes a reference between these two fields. Thus, a large number of field attributes in the dynpro is automatically copied from the ABAP/4 Dictionary. The field attributes together with data element and domain of the assigned Dictionary field form the basis for the standard functions the dynpro executes in a dialog (automatic format check for screen fields, automatic value range check, online help, and so on).
    Error Dialogs
    Another task of the dynpro processor is to conduct error dialogs. Checking the input data is carried out either automatically using check tables of the ABAP/4 Dictionary or by the ABAP/4 program itself. The dynpro processor includes the error message into the received screen and returns the screen to the user. The message may be context-sensitive, that is, the system replaces placeholders in the message text with current field contents. In addition, only fields whose contents is related to the error and for which a correction may solve the error can accept input. 
    P.Naganjana  Reddy
    Data Consistency
    To keep data consistent within complex applications, ABAP/4 offers techniques for
    optimizing database updates that operate independent of the underlying database and correspond to the special requests of dialog programming. For more information on database updates, see Programming Database Updates.
    Dynpro
    Each screen contains fields used to display or request information. Fields can be text strings, input or output fields, radio buttons, checkboxes, or pushbuttons. The screen of Transaction TZ10 contains only texts and input/output fields.
    An SAP dynpro consists of several components:
    &#61472;Flow logic: Calls of the ABAP/4 modules for a screen.
    &#61472;Screen layout: Positions of the texts, fields, pushbuttons, and so on for a screen.
    &#61472;Screen attributes: Number of the screen, number of the subsequent screen, and others.
    &#61472;Field attributes: Definition of the attributes of the individual fields on a screen.
    SCREEN PAINTER
    You create and edit all components of a dynpro in the Screen Painter. To call the Screen
    Painter, create a dynpro in the Object Browser or double-click on an existing dynpro. The Object Browser then calls the Screen Painter. There, you can enter the flow logic of the new dynpro. By pressing the corresponding pushbutton you can maintain the Screen attributes, branch to the Full Screen-Editor or you choose the pushbutton Field list and change the attributes of fields.
    Screen Attributes
    From the user’s point of view, a transaction is a sequence of screens, displayed one after
    another. How do I determine this sequence? The transactions’s attributes determine the first screen to be displayed. The attributes of the individual dynpros determine which screen to display 
    P.Naganjana  Reddy
    after the current screen. You can also set the number of the subsequent screen dynamically from within the ABAP/4 program.
    Layout
    Choose Fullscreen to go to the screen editor. Here you can determine the layout of the
    screen. For Transaction TZ10, the desired fields can be copied from Table SPFLI of the
    ABAP/4 Dictionary.
    Field Attributes
    To display and modify the attributes of the individual fields (input/output fields, input
    required, possible entries button, invisible, and so on), use the Field list.The fields Company (SPFLI-CARRID) and Flight number (SPFLI-CONNID) are defined as input/output fields. All other fields are used only for outputting the flight data.
    Flow Logic
    The flow control code of a dynpro consists of a few statements that syntactically ressemble ABAP/4 statements. However, you cannot use flow contol keywords in ABAP/4 and vice versa. You enter the flow control code in the Screen Painter as one component of the dynpro.
    The flow control for the dynpro of Transaction TZ10 looks like this:
    PROCESS BEFORE OUTPUT.
    MODULE SET_STATUS_0100.
    PROCESS AFTER INPUT
    MODULE USER_COMMAND_0100.
    The PROCESS statement names the event type for the dynpro and the MODULE statement tells the system which ABAP/4 routine to call for this event. In this example, there is only one MODULE for each event PBO and PAI. However, an event can contain several statements with several keywords. (The flow control language contains only few statement types. The most important are MODULE, FIELD, CHAIN, LOOP, CALL SUBSCREEN.) To display information on the statement syntax in the flow logic, choose Utilities Help on... in the flow logic editor. In the subsequent dialog window, mark Flow logickeyword, enter the name of the desired keyword, and press ENTER.
    ABAP/4 Module Pool
    In the Object Browser, the module pool code belongs to one of the following categories:
    &#61472;Global fields: data declarations that can be used by all modules in the module pool
    &#61472;PBO modules: modules that are called before displaying the screen
    &#61472;PAI modules: modules that are called in response to the user input
    &#61472;Subroutines: subroutines that can be called from any position within the module pool.
    You use the ABAP/4 Dictionary to store frequently used data declarations centrally. Objects defined in the Dictionary are known throughout the system. Active Dictionary definitions can be accessed by any application. Data defined in the Dictionary can be included in a screen or used by an ABAP/4 program. You declare global data in the TOP module of the transaction, using the TABLES, STRUCTURE, LIKE statements and others. Transaction TZ10 accesses the Dictionary definition of Table SPFLI to provide the desired flight data display. If the TOP include contains the TABLES: SPFLI declaration, all modules in the module pool can access the table fields of 
    P.Naganjana  Reddy
    Table SPFLI. The PAI module USER_COMMAND_0100 checks which pushbutton the user activated (CASE OK_CODE). The Display pushbutton in Transaction TZ10 has the function code
    ‘SHOW’. (For more information on handling function codes, see Processing User Requests). The program then tries to select those records in the SPFLI database that correspond to the data the user entered. The WHERE condition determines matching records by comparing the fields SPFLI-CARRID and SPFLI-CONNID with the database key fields CARRID and CONNID. As soon as a matching record is found, the database transfers all accompanying SPFLI fields to the program table.
    When the screen is displayed again, the complete information appears in the output fields
    of the screen. The system automatically displays these fields, since the ABAP/4 field names SPFLI-CARRID and SPFLI-CONNID are the same as the screen field names.
    In the PBO module STATUS_0100 of Transaction TZ10, the screen 100 receives a GUI status (using SET PF-STATUS) and a GUI title (using SET TITLEBAR):
    SET PF-STATUS ‘TZ0100’.
    SET TITLEBAR ‘100’.
    A GUI status is a subset of the interface elements used for a certain screen. The status
    Comprise those elements that are currently needed by the transaction. The GUI status for a transaction may be composed of the following elements:
    The GUI title is the screen title displayed in the title bar of the window. In contrast to the
    GUI status that can be used for several screens, a GUI title belongs to one screen.To create and edit GUI status and GUI title, you use the Menu Painter. To start the Menu Painter, create a GUI status or GUI title in an object list in the Object Browser (or double-click on an existing status or title).
    Interaction between Dynpro and ABAP/4 Module Pool
    In its most simple form, a transaction is a collection of screens and ABAP/4 routines, controlled and executed by a dialog processor. The dialog processor processes screen after screen, thereby triggering the appropriate ABAP/4 processing for each screen. For each screen, the system executes the flow logic that contains the corresponding ABAP/4 processing. The control passes from screen flow logic to ABAP/4 code and back.
    The sequence of events for Transaction TZ10, for example, looks like this: 
    P.Naganjana  Reddy
         1.
    In the PBO event, the statement MODULE STATUS_0100 passes control to the corresponding ABAP/4 module.In the ABAP/4 module pool, the screen to be displayed receives a menu interface.
    2.
    After processing the module STATUS_0100, control returns to the flow logic.For the PBO event, no further processing is required. The system display the screen and receives entries from the user. The entries are:
    the values for the fields Company and Flight number.
    the four-character function code that tells which pushbutton the user activated.
         3.
    The user input triggers the PAI event. The first PAI statement passes control to the ABAP/4 module USER_COMMAND_0100.Module USER_COMMAND_0100 processes the requests of the user.
    4. After processing MODULE USER_COMMAND_0100, control returns to PAI. This terminates the dialog. 
    P.Naganjana  Reddy
    EXERCISE
    Goto to ABAP editor, and enter the program name ZKA_SCREEN.
    Declare the tables and call the screen.
    In order to create the object, double click on the screen no, you will automatically guided to the screen painter SE51. 
    P.Naganjana  Reddy
    Enter the short description and click on the FLOW LOGIC tab.
    Uncomment the flow logic, both PAI and PBO. 
    P.Naganjana  Reddy
    Now click on the LAYOUT button.
    Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM DIC button and select the fields required for the screen and click on the COPY button. 
    P.Naganjana  Reddy
    Now drag and place the INPUT/OUTPUT fields box on the screen.
    Now click on the TEXT FIELD button and place in the screen and stretch the box for the size required. Now double click on the box, U will get the attributes screen. Enter the name and Text for the field. 
    P.Naganjana  Reddy
    Now we need to place the bush buttons. So Click on the push button on the left side and place it on the screen. Double click on it, u will get the attributes screen. Enter the name, text and the icon required and mainly the FCTCODE. It is the one which links the screen painter with the code.
    Once everything is set up, SAVE, CHECK and ACTIVATE the screen. 
    P.Naganjana  Reddy
    Click on the BACK button. U will be guided to the FLOW LOGIC screen.
    Double click on PAI, Because for the screen painter with the fields, Process After the Input is done and so u will guided to the Editor screen. 
    P.Naganjana  Reddy
    Now we need to set the System-Uses commands which links the code to the Editor.
    So the conditions would be:
    IF SY-UCOMM = 'DISPLAY'.
    SELECT SINGLE * FROM ZKA_CENTER WHERE CENTERNO = ZKA_CENTER-CENTERNO.
    ELSEIF SY-UCOMM ='SAVE'.
    INSERT ZKA_CENTER.
    ELSEIF SY-UCOMM = 'REFRESH'.
    CLEAR ZKA_CENTER.
    ELSEIF SY-UCOMM = 'GOTO'.
    LEAVE TO SCREEN '0002'.
    ELSEIF SY-UCOMM = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF.
    If u create many screens and need links between the screens then u can use ‘GOTO’ to guide to the other screen.
    SAVE, CHECK and ACTIVATE and click on TEST. 
    P.Naganjana  Reddy
    Now click on the DISPLAY button.
    Also verify with SAVE, REFRESH and EXIT buttons. Thus the screen painter. 
    P.Naganjana  Reddy
    TABLE CONTROL
    Basic form
    CONTROLS ctrl TYPE TABLEVIEW USING SCREEN scr.
    Effect
    Creates a table control ctrl of the type TABLEVIEW . The reference screen for the initialization is the screen scr . Area of use The table control (referred to here as TC ) facilitates the display and entry of one-line, tabular data in dialog transactions. The functional scope has been defined so that you can implement many typical set operations usually handled by an elementary STEP-LOOP with the standard methods of a TC . Functional scope
    Resizeable table grid for displaying and editing data.
    Column width and column position modifiable by user and by program.
    Storing and loading of user-specific column layout.
    Selection column for line selection with color selection display.
    Variable column headers as pushbuttons for column selection.
    Simple selection, multiple selection, Select/deselect all.
    Scrolling functions (horizontal and vertical) via scroll bar.
    Fixing of any number of key columns.
    Setting attributes for each cell at runtime.
    Programming The data exchange between the application and the SAPgui is achieved with a STEP-LOOP , i.e. an ABAP/4 module is called to transfer data for each page.
    Example
    Processing without an internal table
    PROCESS BEFORE OUTPUT.
    LOOP WITH CONTROL ctrl.
    MODULE ctrl_pbo.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL ctrl.
    MODULE ctrl_pai.
    ENDLOOP.
    In this case, the module ctrl_pbo OUTPUT is called once for each output line before the screen is displayed, in order to fill the output fields. After the user has entered data on the screen, the module ctrl_pai INPUT is executed to check the input and copy the new contents.
    Example
    Processing with an internal table 
    P.Naganjana  Reddy
    PROCESS BEFORE OUTPUT.
    LOOP AT itab WITH CONTROL ctrl CURSOR ctrl-CURRENT_LINE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT itab WITH CONTROL ctrl.
    MODULE ctrl_pai.
    ENDLOOP.
    Here, the system fills the output fields before displaying the screen by reading the internal table itab. When the user has entered data, the module ctrl_pai INPUT must be executed to check the input and to refresh the contents of the internal table. Vertical scrolling with the scroll bar is followed by the event PAI for the displayed page. Then, cntl-TOP_LINE is increased and PBO is processed for the next page. Program-driven scrolling and the most of the functionality described above is achieved by manipulating the control attributes.
    Attributes The CONTROLS statement creates a complex data object of the type CXTAB_CONTROL with the name of the control. You maintain the initial values in the Screen Painter and assign the screen with the initial values for a control using the addition USING SCREEN . Initialization is achieved automatically in the "1st access to the control" (setting or reading values). You can use the customizing button (in the top right corner) to save the current setting (column widths and column positions) and use it as the initial value for the next call. All the initial values can be overwritten by the program using the MOVE ... TO TC attributes statement.
    EXERCISE
    Enter the Editor with SE38.
    Declare the Tables and an internal table.
    Then use the CONTROLS statement to have the controls for the Table control. 
    P.Naganjana  Reddy
    CONTROLS: <var> TYPE TABLEVIEW USING SCREEN '<screenno>'.
    Now call the screen with the CALL SCREEN statement. Click on the screen to draw the table.
    Fill in the attributes screen with the short description and click on the LAYOUT button.
    Now click on the TABLE CONTROL button and draw the table to the size required. Double click on the table and enter the Attributes giving the Table-control name.
    And select the check boxes for the vertical & horizontal resizing and separators.
    Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM PROGRAM button and select the fields required for the screen and click on the COPY button. 
    P.Naganjana  Reddy
    Enter the header with the TEXT FIELDS button by double clicking on the TEXT FIELD and fill in the ATTRIBUTES button with the name and text. 
    P.Naganjana  Reddy
    SAVE, CHECK & ACTIVATE.
    Click the BACK button and go the FLOW LOGIC screen. 
    P.Naganjana  Reddy
    REPORT ZKA_TC .
    TABLES: ZKA_EMP.
    DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE.
    CONTROLS: TC TYPE TABLEVIEW USING SCREEN '0001'.
    CALL SCREEN '0001'.
    *& Module STATUS_0001 OUTPUT
    text
    MODULE STATUS_0001 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    SELECT * FROM ZKA_EMP INTO TABLE ITAB.
    ENDMODULE. " STATUS_0001 OUTPUT
    *& Module USER_COMMAND_0001 INPUT 
    P.Naganjana  Reddy
    text
    MODULE USER_COMMAND_0001 INPUT.
    IF SY-UCOMM = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0001 INPUT 
    P.Naganjana  Reddy
    TABSTRIP CONTROLS
    A tabstrip control is a screen object consisting of two or more pages. Each tab page consists of a tab title and a page area. If the area occupied by the tabstrip control is too narrow to display all of the tab titles, a scrollbar appears, allowing you to reach the titles that are not displayed. There is also a pushbutton that allows you to display a list of all tab titles.
    Tabstrip controls allow you to place a series of screens belonging to an application on a single screen, and to navigate between them easily. The recommended uses and ergonomic considerations for tabstrip controls are described in the Tabstrip Control section of the SAP Style Guide.
    From a technical point of view, a tab page is a subscreen with a pushbutton assigned to it, which is displayed as the tab title.
    The tabstrip control is the set of all the tab pages. Tabstrip controls are therefore subject to the same restrictions as subscreens. In particular, you cannot change the GUI status 
    P.Naganjana  Reddy
    when you switch between pages in the tabstrip control. However, they are fully integrated into the screen environment, so present no problems with batch input.
    To use a tabstrip control on a screen, you must be using a SAPgui with Release 4.0 or higher, and its operating system must be Motif, Windows 95, MacOS, or Windows NT with version 3.51 or higher.
    When you create a tabstrip control, you must:
    Define the tab area on a screen and the tab titles.
    Assign a subscreen area to each tab title.
    Program the screen flow logic.
    Program the ABAP processing logic.
    You must then decide whether you want to page through the tabstrip control at the SAPgui or on the application server. In the first case, each tab page has its own subscreen. In the second, there is a single subscreen area that is shared by all tab pages.
    Defining the Tabstrip Control Area and Tab Titles
    You define both the tabstrip area and the tab titles in the screen layout. The tabstrip area has a unique name and a position, length, and height. You can also specify whether the tabstrip area can be resized vertically or horizontally when the user resizes the window. If the area supports resizing, you can specify a minimum size for it.
    When you define a tabstrip area, it already has two tab titles. Tab titles are technically exactly the same as pushbuttons. To create additional tab titles, simple create pushbuttons in the row containing the tab titles. Tab titles have the same attributes as pushbuttons, that is, each has a name, a text, and a function code. You can also use icons and dynamic texts with tab titles.
    Assigning a Subscreen Area to a Tab Title
    You must assign a subscreen area to each tab title. There are two ways of doing this:
    Paging in the SAPgui
    You need to assign a separate subscreen area to each tab title, and define the function codes of the tab titles with type P (local GUI function). In the screen flow logic, you call all the subscreens in the PBO event. This means that all of the tab pages reside locally on the SAPgui.
    When the user chooses a tab title, paging takes place within the SAPgui. In this respect, the tabstrip control behaves like a single screen. In particular, the PAI event is not triggered when the user chooses a tab title, and no data is transported. While this improves the performance of your tabstrip control, it also has the negative effect that when the user does trigger the PAI event, all of the input checks for all of the subscreens are performed. This means that when the user is working on one tab page, the input checks may jump to an unfilled mandatory field on another page. 
    P.Naganjana  Reddy
    Local paging at the SAPgui is therefore most appropriate for screens that display data rather than for input screens.
    Paging on the Application Server
    One subscreen area is shared by all tab titles and called in the PBO event. You define the function codes of the individual tab titles without a special function type. When the user chooses a tab page, the PAI event is triggered, and you must include a module in your flow logic that activates the appropriate tab page and assigns the correct subscreen to the subscreen area.
    Since the PAI event is triggered each time the user chooses a tab title, this method is less economical for the application server, but the input checks that are performed only affect the current tab page.
    Procedure in Either Case
    You create the subscreen areas within the tabstrip area. You assign the subscreen areas to one or more tab titles in the Screen Painter by selecting one or more titles. You can also assign a subscreen area to a tab title in the tab title attributes by entering the name of the subscreen area in the Reference field attribute.
    The procedure for the alphanumeric Screen Painter is described under Creating Tabstrip Controls.
    If you are paging at the SAPgui, create a subscreen area for each tab title. If you are paging at the application server, select all tab titles and create a single subscreen area. The subscreen areas may not cover the top line of the tab area. However, within a tab area, more than one subscreen area can overlap.
    Programming the Flow Logic
    In the flow logic, all you have to do by hand is include the correct subscreens. The screen flow and data transport to the ABAP program is the same as for normal subscreens. There are two ways of programming the screen flow logic, depending on how you have decided to page through the tabstrip control.
    Paging in the SAPgui
    When you page in the SAPgui, you must include a subscreen for each subscreen area:
    PROCESS BEFORE OUTPUT. ... CALL SUBSCREEN: <area1> INCLUDING [<prog 1>] <dynp 1>, <area2> INCLUDING [<prog 2>] <dynp 2>, <area3> INCLUDING [<prog 3>] <dynp 3>, ... ... 
    P.Naganjana  Reddy
    PROCESS AFTER INPUT. ... CALL SUBSCREEN: <area1>, <area2>, <area3>, ... ...
    Paging on the Application Server
    When you page on the application server, you only have to include a subscreen for the one subscreen area:
    PROCESS BEFORE OUTPUT. ... CALL SUBSCREEN <area> INCLUDING [<prog>] <dynp>. ...
    PROCESS AFTER INPUT. ... CALL SUBSCREEN <area>. ...
    Handling in the ABAP Program
    Before you can use a tabstrip control in your ABAP program, you must create a control for each control in the declaration part of your program using the following statement:
    CONTROLS <ctrl> TYPE TABSTRIP.
    where <ctrl> is the name of the tabstrip area on a screen in the ABAP program. The control allows the ABAP program to work with the tabstrip control. The statement declares a structure with the name <ctrl> . The only component of this structure that you need in your program is called ACTIVETAB.
    Use in the PBO event
    Before the screen is displayed, you use the control to set the tab page that is currently active. To do this, assign the function code of the corresponding tab title to the component ACTIVETAB:
    <ctrl>-ACTIVETAB = <fcode>.
    When you page at the SAPgui, you only need to do this once before the screen is displayed. This initializes the tabstrip control. The default active tab page is the first page. After this, the page activated when the user chooses a tab title is set within SAPgui.
    When you page on the application server, you must assign the active page both before the screen is displayed for the first time, and each time the user pages. At the same time, you must set the required subscreen screen. 
    P.Naganjana  Reddy
    You can suppress a tab page dynamically by setting the ACTIVE field of table SCREEN to 0 for the corresponding tab title.
    Use in the PAI event
    In the PAI event, ACTIVETAB contains the function code of the last active tab title on the screen. When you page in the SAPgui, this allows you to find out the page that the user can currently see. When you page at the application server, the active tab page is controlled by the ABAP program anyway. The OK_CODE field behaves differently according to the paging method:
    Paging in the SAPgui
    When you page in the SAPgui, the PAI event is not triggered when the user chooses a tab title, and the OK_CODE field is not filled. The OK_CODE field is only filled by user actions in the GUI status or when the user chooses a pushbutton either outside the tabstrip control or on one of the subscreens.
    Paging on the application server
    If you are paging at the application server, the PAI event is triggered when the user chooses a tab title, and the OK_CODE field is filled with the corresponding function code. To page through the tabstrip control, you must assign the function code to the ACTIVETAB component of the control:
    <ctrl>-ACTIVETAB = <ok_code>.
    This statement overwrites the function code of the last active tab page with that of the new tab title. At the same time, you must ensure that the correct subscreen is inserted in the subscreen area. Otherwise, tabstrip controls are handled like normal subscrens in ABAP programs, that is, the ABAP program of a subscreen screen must contain the dialog modules called from the flow logic of the subscreen. 
    P.Naganjana  Reddy
    EXERCISE
    Goto SE38. Enter the tabstrip program name Eg: ZKA_TABSTRIP and click on the create button.
    First we need to declare the tables.
    Then use the controls for the tabstrip.
    Syntax: <ctrl-name> TYPE TASTRIP.
    Now call the screen. Using CALL SCREEN statement.
    Double click on the screen no to draw the screen for tabstrip control.
    Now uncomment the FLOW LOGIC and click on the LAYOUT. 
    P.Naganjana  Reddy
    The flow logic for the tabstrip would be as follows.
    PBO:
    The PBO is initiated so that the subscreen for the corresponding tab can be maintained.
    Syntax:
    CALL SUBSCREEEN <sub-screen name> INCLUDING SY-REPID <screen-var>.
    PAI:
    When the tab is clicked, the corresponding subscren should open
    Syntax:
    CALL SUBSCREEN <subscreen>. 
    P.Naganjana  Reddy
    DRAWING THE TABSTRIP CONTROL:
    Click on the TABSTRIP button and place it on the screen for the required size.
    Double click on the control and give the name for the tabstrip control in the ATTRIBUTES screen.
    Now double click on the tab and fill in the attributes screen for the name and the text.
    Also draw the subscreen in one of the tab and refer the same subscreen in the rest of the tabs. 
    P.Naganjana  Reddy
    Now in the sub-screens, we need to get the screen for the tabs.
    So call an other screen and draw with fields and pushbuttons to perform actions very similar like SCREEN WITH FIELDS (refer screen painter).
    Enter the short description and click on the FLOW LOGIC tab. 
    P.Naganjana  Reddy
    Uncomment the flow logic, both PAI and PBO.
    Now click on the LAYOUT button. 
    Naganjana Reddy.P
    Click on the DICTIONARY/PROGRAM FIELDS WINDOW F6 button. Type in the table name and click on GET FROM DIC button and select the fields required for the screen and click on the COPY button.
    Now drag and place the INPUT/OUTPUT fields box on the screen. 
    P.Naganjana  Reddy
    Now click on the TEXT FIELD button and place in the screen and stretch the box for the size required. Now double click on the box, U will get the attributes screen. Enter the name and Text for the field.
    Now we need to place the bush buttons. So Click on the push button on the left side and place it on the screen. Double click on it, u will get the attributes screen. Enter the name, text and the icon required and mainly the FCTCODE. It is the one which links the screen painter with the code. 
    P.Naganjana  Reddy
    Once everything is set up, SAVE, CHECK and ACTIVATE the screen. 
    P.Naganjana  Reddy
    Click on the BACK button. U will be guided to the FLOW LOGIC screen.
    Double click on PAI, Because for the screen painter with the fields, Process After the Input is done and so u will guided to the Editor screen. 
    P.Naganjana  Reddy
    Now we need to set the System-Uses commands which links the code to the Editor.
    So the conditions would be:
    IF SY-UCOMM = 'DISPLAY'.
    SELECT SINGLE * FROM ZKA_CENTER WHERE CENTERNO = ZKA_CENTER-CENTERNO.
    ELSEIF SY-UCOMM ='SAVE'.
    INSERT ZKA_CENTER.
    ELSEIF SY-UCOMM = 'REFRESH'.
    CLEAR ZKA_CENTER.
    ELSEIF SY-UCOMM = 'GOTO'.
    LEAVE TO SCREEN '0002'.
    ELSEIF SY-UCOMM = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF.
    The same procedure for the company table as well will lead the screen in the below manner. 
    P.Naganjana  Reddy
    Summary:
    REPORT ZKA_TABSTRIP .
    TABLES: ZKA_EMP,ZKA_COM.
    CONTROLS: TS TYPE TABSTRIP..
    DATA: SCREENNO(4) TYPE N.
    CALL SCREEN '0003'.
    *& Module STATUS_0001 OUTPUT
    text
    MODULE STATUS_0001 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    IF SCREENNO IS INITIAL.
    TS-ACTIVETAB = 'EMP'.
    SCREENNO = '0002'.
    ENDIF.
    ENDMODULE. " STATUS_0001 OUTPUT
    *& Module USER_COMMAND_0001 INPUT
    text
    MODULE USER_COMMAND_0001 INPUT.
    IF SY-UCOMM = 'EMP'.
    TS-ACTIVETAB = 'EMP'.
    SCREENNO = '0002'.
    ELSEIF SY-UCOMM = 'COM'.
    TS-ACTIVETAB = 'COM'.
    SCREENNO = '0003'.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0001 INPUT
    *& Module USER_COMMAND_0002 INPUT
    text
    MODULE USER_COMMAND_0002 INPUT.
    IF SY-UCOMM = 'DISPLAY'.
    SELECT SINGLE * FROM ZKA_EMP WHERE EMPNO = ZKA_EMP-EMPNO.
    ELSEIF SY-UCOMM = 'SAVE'.
    INSERT ZKA_EMP.
    ELSEIF SY-UCOMM = 'REFRESH'.
    CLEAR ZKA_EMP.
    ELSEIF SY-UCOMM = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF. 
    P.Naganjana Reddy

  • Transformation routine on 2 different targets fields

    Hi gurus,
    I have been trying do some ABAP transformation routines, I did 1 and it was good works fine, then I tried to create another transformation routine on a different target field of the same DSO, and for some reason what I did on the global declaration on the other transformation is in this transformation and if I do a change in the second transformation it shows in the first transformation, other thing is that in the second transformation anything works, I got errors for everything and are not very specific. I may be skipping some basic steps; maybe I canu2019t create 2 transformation routines in the same transformation?
    Thanks

    Hi,
    There can be just 1 start routine.
    These are execute once. Also the declarations done in the global section remain visible in all the transformation routines.
    You can write multiple transformation(field level) routines.
    -Mayuri

Maybe you are looking for

  • Firefox is crashing when multiple tabs are open

    I have used Firefox for years but have never had so much trouble as I am having in the last few days. Constant crashing when I have multiple tabs open. I used to be able to have as many as a dozen tabs open. Now if I have as few as 3, crash after cra

  • Obiee oracle gateway error while updating row count

    Hi , OBIEE server 11.1.1.5 ,oracle server11g installed in linux 64bit, while updating row count in Admin tool i am getting the following error [NQODBC][SQL_STATE:HY000][nQSError:10058] A general error has occured. [nQSError: 43113]Message returned fr

  • Can I turn my iMac into an airplay speaker?

    I have several ATV's and a few airplay speakers around the house but I would like to stream from my iphone or ipad to my iMac computer (which has speakers attached to the computer). Is there a way to airplay from my iOS device to my computer? I have

  • Where do I find locations under settings?

    I Have an iPhone 6 and locations is not working when I try to check in on facebook. it says go to Settings then Locations but I can't find it. Is it under another tab? THank you tina

  • IceWM's icecurcfg can't load gt-Module

    Hi there, I've just installed the packages "icewm" and "icewm-utils" via pacman. When I try to start icecurcfg from the icewm-utils package in order to configure my mouse curser, I get the following error message: schorsch@archie:~$ icecurcfg Traceba