Wednesday 14 September 2011

Useful ABAP commands

some useful ABAP statements.
*************************************
Sandeepkumar Jetty    15/09/2011
*************************************
1)DESCRIBE FIELD text LENGTH len IN CHARACTER MODE.
2)Regarding the Field symbols:
DATA: BEGIN OF line,
         col1(1) TYPE c,
         col2(1) TYPE c VALUE 'X',
       END OF line.
FIELD-SYMBOLS <fs> LIKE line.
ASSIGN line TO <fs>.
MOVE <fs>-col2 TO <fs>-col1.
WRITE: <fs>-col1, <fs>-col2.
3)Assigning valuse using Write to:
DATA: name(10)   TYPE c VALUE 'SOURCE',
      source(10) TYPE c VALUE 'Antony',
      target(10) TYPE c.
...
WRITE (name) TO target.
WRITE target.
4)Selection screen control:
PARAMETERS: sdate TYPE sy-datum,
            edate TYPE sy-datum.
PARAMETERS: male RADIOBUTTON GROUP g1 USER-COMMAND a,
            fmale RADIOBUTTON GROUP g1 .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: h1 AS CHECKBOX MODIF ID abc,
            h2 AS CHECKBOX MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: h3 AS CHECKBOX MODIF ID def,
            h4 AS CHECKBOX MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.

INITIALIZATION.
  edate =  sy-datum.
  sdate = sy-datum.
  sdate+6(2) = '01'.
AT SELECTION-SCREEN OUTPUT.
  IF fmale IS NOT INITIAL.
    LOOP AT SCREEN.
      IF screen-group1 eq 'ABC' .
*       screen-input = 0.
       screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
ELSe.
LOOP AT SCREEN.
      IF screen-group1 eq 'DEF' .
*       screen-input = 0.
       screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
ENDIF.
5)MULTIPLY-CORRESPONDING
DATA: BEGIN OF rate,
         usa TYPE f VALUE '0.6667',
         frg TYPE f VALUE '1.0',
         aut TYPE f VALUE '7.0',
      END OF rate.
DATA: BEGIN OF money,
         usa TYPE i VALUE 100,
         frg TYPE i VALUE 200,
         aut TYPE i VALUE 300,
      END OF money.
MULTIPLY-CORRESPONDING money BY rate.
WRITE / money-usa.
WRITE / money-frg.
WRITE / money-aut.

6) Addition statements:
DATA: BEGIN OF series,
         n1 TYPE i VALUE 10,
         n2 TYPE i VALUE 20,
         n3 TYPE i VALUE 30,
         n4 TYPE i VALUE 40,
         n5 TYPE i VALUE 50,
         n6 TYPE i VALUE 60,
      END OF series.
DATA sum TYPE i.
ADD series-n1 THEN series-n2 UNTIL series-n5 GIVING sum.
7)shifting strings by a given number of places
DATA: t1(10) TYPE c VALUE 'abcdefghij',
      string1 LIKE t1.
string1 = t1.
WRITE string1.
SHIFT string1.
WRITE / string1.
string1 = t1.
SHIFT string1 BY 3 PLACES LEFT.
WRITE / string1.
string1 = t1.
SHIFT string1 BY 3 PLACES RIGHT.
WRITE / string1.
string1 = t1.
SHIFT string1 BY 3 PLACES CIRCULAR.
WRITE / string1.
o/p: abcdefghij
bcdefghij
defghij
   abcdefg
defghijabc
********************************************************
17/08/2011
8) Checking selection criteria
SELECT-OPTIONS s_carrid FOR wa-carrid.
IF 'LH' IN s_carrid.
  WRITE 'LH was selected'.
ENDIF.
9)Case statements
CASE string.
  WHEN text1 OR text2.
    WRITE: / 'String is', text1, 'OR', text2.
  WHEN text3.
    WRITE: / 'String is', text3.
  WHEN OTHERS.
    WRITE: / 'String is not', text1, text2, text3.
ENDCASE.
10) SKIP: it will leave one line space.
11)Do 'N' times
DO 2 TIMES.
  WRITE sy-index.
  SKIP.
  DO 3 TIMES.
    WRITE sy-index.
  ENDDO.
  SKIP.
ENDDO.
SKIP.
ULINE.
12)SHIFT string: it will move string one position left.
13)REFRESH itab: it will refresh(delete all data) internal table.
14)FREE itab: it will release the internal table space.
15)APPEND line TO itab: It will append the new records at  the end of internal table .
16)DESCRIBE TABLE itab LINES lin OCCURS ini KIND knd--
 it will count the total rows in the table and occures will give the initial size
and the kind will give the table type(hashed, sorted,etc)
DATA itab LIKE HASHED TABLE OF line WITH UNIQUE KEY col1
                                    INITIAL SIZE 10.
here lin = 10 and knd = H.
17)READ TABLE itab FROM line INTO line COMPARING col2.
It will read the table ITAB into line based on the valuse in the line by comparing col2.
18)CLEAR line: it will give the initial values.
19)READ TABLE itab WITH TABLE KEY col1 = 3
                INTO line TRANSPORTING col2.
it will read the table itab with key col1 and it will transport only col2 value to line.
20)READ TABLE itab WITH KEY col2 = 16  TRANSPORTING NO FIELDS.
It wont transport any values.
21)READ TABLE itab WITH TABLE KEY col1 = 2 ASSIGNING <fs>.
It will read the table itab and it will assign that particular value to the field symbol.
22)FIELD-SYMBOLS <fs> LIKE LINE OF itab: We have to define the field symbols like this.
and to refere a veriable  <fs>-col2 = 100.
23)MODIFY TABLE itab FROM line: it will modify that particular value.
24)Changing lines using the condition:
MODIFY itab FROM line TRANSPORTING col2
            WHERE ( col2 > 1 ) AND ( col1 < 4 ).
25)Deleting a Line Using the Table Key :
DELETE TABLE itab: FROM line,
                   WITH TABLE KEY col1 = 3.
26)Deleting a Line Using a Condition :
DELETE itab WHERE ( col2 > 1 ) AND ( col1 < 4 ).
27)Deleting Duplicate Entries :
DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.
DELETE ADJACENT DUPLICATES FROM itab COMPARING col1.
DELETE ADJACENT DUPLICATES FROM itab.
SKIP TO LINE 3---- it will skip to line 3.
28)LOOP AT itab INTO line.
  WRITE: / line-col1, line-col2, line-col3.
  AT END OF col1.
    SUM.
    ULINE.
    WRITE: / line-col1, line-col2, line-col3.
    SKIP.
  ENDAT.
  AT LAST.
    SUM.
    ULINE.
    WRITE: / line-col1, line-col2, line-col3.
  ENDAT.
ENDLOOP.
The AT END OF col1 stmt will come to action at the end of col1 smae values
The ATLAST stmt will activate at the end of the whole table.
29)AT FIRST.
    WRITE / 'List of Bookings'.
    ULINE.
  ENDAT.
It will activate before writing the first record.
 
AT NEW carrid.
    WRITE: / 'Carrid:', line-carrid.
  ENDAT.
For every new record it will act.
30)Append statements:
APPEND line2 TO tab2.
APPEND LINES OF jtab FROM 2 TO 3 TO itab1.
APPEND line3 TO itab2 SORTED BY col2.
31)Insert the lines into ITAB.
INSERT line INTO itab INDEX 2--it will insert the new record in second row(index-2)
INSERT INITIAL LINE INTO itab INDEX 1.---it will insert the initial values in first line.
READ TABLE itab ASSIGNING <fs> INDEX 7.
32)Binary search
READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.
33)Searching for Strings in Lines :
SEARCH itab FOR 'string05' AND MARK.
WRITE: / '''string05'' found at line', (1) sy-tabix,
         'with offset', (1) sy-fdpos.
The above will give u the string position and the offset.
34)Changing Single Lines Using MODIFY 1:
LOOP AT itab INTO line.
  IF sy-tabix = 2.                                ----------when table count is reaches  to 2 the below stepa will execute.
    line-col1 = sy-tabix * 10.
    line-col2 = ( sy-tabix * 10 ) ** 2.
    MODIFY itab FROM line.         --------and itab will modify to that values based on tabix.
  ENDIF.
ENDLOOP.
35)MODIFY itab FROM line INDEX 2 TRANSPORTING (name).
      MODIFY itab FROM line INDEX 3.
Here: DATA name(4) TYPE c VALUE 'COL2'.
DATA: BEGIN OF line,
         col1 TYPE i,
         col2 TYPE i,
      END OF line.
36)DATA text(72) TYPE c.
       DATA code LIKE TABLE OF text.
       text = 'This is the second line. It is ugly.'.
       APPEND text TO code.
      WRITE 'nice.' TO code+31 INDEX 2.
o/p: This is the second line. It is nice.
37)Deleting Single lines Using Index :
DELETE itab INDEX: 2, 3, 4.
38)Deleting Single Lines in Loops :
LOOP AT itab INTO line.
  IF line-col1 < 28.
    DELETE itab.
  ENDIF.
ENDLOOP.
Deleting Lines Using the Index :
DELETE itab FROM 3 TO 38 WHERE col2 > 20
39)Specifying the Index in a Loop :
LOOP AT itab INTO line FROM 10 TO 25 WHERE col2 > 400.
  WRITE: / sy-tabix, line-col2.
ENDLOOP.
EXTRACTS:
******************************
40)Table areas declared with NODES behave like common data declared
with addition COMMON PART: They are shared by the programs of a program group.
NODES: spfli, sflight.
FIELD-GROUPS: header, flight_info, flight_date.
INSERT: spfli-carrid spfli-connid sflight-fldate
        INTO header,
        spfli-cityfrom spfli-cityto
        INTO flight_info.
START-OF-SELECTION.
GET spfli.
  EXTRACT flight_info.
FIELD-GROUPS { header | field_group }.
Effect :
Declaration of a field group for the extract dataset of the program.
Each field group represents the name of a line structure of the extract dataset.
You can create as many field groups as you wish in a program.
You define the actual components of a field group with the statement INSERT.
41)Order By:
SELECT * FROM spfli INTO wa_spfli
                    ORDER BY cityfrom cityto connid.
SELECT * FROM sflight INTO wa_sflight
                        WHERE carrid = wa_spfli-carrid
                          AND connid = wa_spfli-connid
                        ORDER BY fldate.
42)SUBMIT demo_data_ext_cluster_import2 AND RETURN.
The SUBMIT statement accesses an executable program rep.
 The executable program is executed as described under Calling Executable Reports.
The AND RETURN addition determines the object accessed by the runtime
environment after program access is completed:
43)Saving Data Objects in Memory :
EXPORT itab
  TO MEMORY ID 'table'.
DATA: text(10) TYPE c VALUE '0123456789',
      iden(3)  TYPE c VALUE 'XYZ'.
EXPORT text TO MEMORY ID iden.
text = 'xxxxxxxxxx'.
IMPORT text FROM MEMORY ID iden.
WRITE: / sy-subrc, text.
FREE MEMORY ID iden.---( it will free the memory id.)
text = 'xxxxxxxxxx'.
IMPORT text FROM MEMORY ID iden.
WRITE: / sy-subrc, text.
44)sy-opsys: Operating System of Application Server
45)Macros: The statement DEFINE defines a macro.
DEFINE output.
  write: / 'The result of &1 &2 &3 is', &4.
END-OF-DEFINITION.
46) Ending subroutine with EXIT and CHECK
PERFORM divide USING num1 num2 CHANGING res.
FORM divide USING    n1 TYPE any
                     n2 TYPE any
            CHANGING r  TYPE any.
  CHECK n2 NE 0.                            " we can use the check here.
  r = n1 / n2.
  WRITE: / n1, '/', n2, '=', r.
ENDFORM.
47)Calling Internal Subroutines :
PERFORM addit.
FORM addit.
  sum = num1 + num2.
  PERFORM out.
ENDFORM.
FORM out.
  WRITE: / 'Sum of', num1, 'and', num2, 'is', sum.
ENDFORM.
48)Calling External Subroutines :
PERFORM header(demo_mod_tech_formpool_1) IF FOUND.
49)Dynamic Subroutine Calls :
subrname = 'SUB2'.
PERFORM (subrname) IN PROGRAM (progname) IF FOUND.
50)Checking Authorizations :
AT SELECTION-SCREEN.
  AUTHORITY-CHECK OBJECT 'S_CARRID'
           ID 'CARRID' FIELD pa_carr
           ID 'ACTVT' FIELD '03'.
51)GET RUN TIME FIELD :(To get run time)
DATA t TYPE i.
GET RUN TIME FIELD t.
WRITE: / 'Runtime', t.
52)New Dynamic Program :(to call a report program dynamically)
INSERT REPORT 'demo_special_tech_ZDYN1' FROM code.
53)Upper and Lower case:
PARAMETERS: field1(10) TYPE c,
            field2(10) TYPE c LOWER CASE.
* to translate the text from lower case to upper case.
set locale language sy-langu.
translate text to upper case.
54)Reducing visible length :
PARAMETERS: p1(10) TYPE c VISIBLE LENGTH 1,
            p2(10) TYPE c VISIBLE LENGTH 5,
            p3(10) TYPE c VISIBLE LENGTH 10.
55)Defining Mandatory Fields :
PARAMETERS field(10) TYPE c OBLIGATORY.
56)Parameters with search help :
PARAMETERS p_carrid TYPE s_carr_id MATCHCODE OBJECT demo_f4_de.
57)Checking Input Values :
PARAMETERS p_carr TYPE spfli-carrid OBLIGATORY VALUE CHECK.
58) Defining  the radiobuttons:
PARAMETERS: r1 RADIOBUTTON GROUP rad1,
            r2 RADIOBUTTON GROUP rad1 DEFAULT 'X',
            r3 RADIOBUTTON GROUP rad1,
            s1 RADIOBUTTON GROUP rad2,
            s2 RADIOBUTTON GROUP rad2,
            s3 RADIOBUTTON GROUP rad2 DEFAULT 'X'.
59)Modifying Input Fields :
PARAMETERS: test1(10) TYPE c MODIF ID sc1,
            test2(10) TYPE c MODIF ID sc2,
            test3(10) TYPE c MODIF ID sc1,
            test4(10) TYPE c MODIF ID sc2.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-group1 = 'SC1'.
      screen-intensified = '1'.
      MODIFY SCREEN.
      CONTINUE.
    ENDIF.
    IF screen-group1 = 'SC2'.
      screen-intensified = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
The CONTINUE statement can only be used in loops. If it is used,
the current loop pass is ended immediately and the program flow is continued with the next loop pass.
Countinue: If the statement is satisfied the current loop will end immediately and it will go to the next loop stmt.
if not satisfied it will execute the next statements.
Check: it will be used in the loop statements and if the condition is satisfied then it will execute the
next statements and or otherwise it will go to the next loop.
EXIT statement is listed within a loop, it leaves the loop by ending the current loop process.
 Program execution is continued after the closing statement in the loop.

60)Screen fields:
                                                    value '0'                                                        value '1'
SCREEN-REQUIRED------no action                                                       it will act as mandatory field.
SCREEN-INPUT-----------the field cant editable in screen        all fields will enable.
SCREEN-OUTPUT--------the scereen field name disabled        no action
SCREEN-INTENSIFIED--- no action                                                      it will change the colour of the field name.
SCREEN-INVISIBLE------no action                                                        the field wont visible and u cant give the input to that.
SCREEN-LENGTH--------no action                                     no action
SCREEN-ACTIVE--------the total field will disabled.                    no action
SCREEN-DISPLAY_3D--no action                                                           it will display the output fields differently
SCREEN-VALUE_HELP--no action                                                         it will give the F4 help for the particular screen fields.
SCREEN-REQUEST------no action                                                         no action
SCREEN-VALUES_IN_COMBO--no action                                          it will show the previous values for that field(Drilldown List allow)
SCREEN-COLOR---------------it will change the color
22/08/2011
***************************************************
61)Report program for selection screen PF-Ststus:
REPORT demo_dynpro_status_icons.
DATA value TYPE i VALUE 1.
DATA: status_icon TYPE icons-text,
      icon_name(20) TYPE c,
      icon_text(10) TYPE c.
CALL SCREEN 100.
MODULE set_icon OUTPUT.
  SET PF-STATUS 'SCREEN_100'.
  CASE value.
    WHEN 1.
      icon_name = 'ICON_GREEN_LIGHT'.
      icon_text =  text-003. "Low
    WHEN 2.
      icon_name = 'ICON_YELLOW_LIGHT'.
      icon_text =  text-002. "Medium
    WHEN 3.
      icon_name = 'ICON_RED_LIGHT'.
      icon_text =  text-001. "High
  ENDCASE.
  CALL FUNCTION 'ICON_CREATE'
       EXPORTING
            name                  = icon_name
            text                  = icon_text
            info                  = 'Status'
            add_stdinf            = 'X'
       IMPORTING
            result                = status_icon
       EXCEPTIONS
            icon_not_found        = 1
            outputfield_too_short = 2
            OTHERS                = 3.
  CASE sy-subrc.
    WHEN 1.
      MESSAGE e888(sabapdocu) WITH text-004. "Icon does not exist
    WHEN 2.
      MESSAGE e888(sabapdocu) WITH text-005. "Icon and text do not fit on screen
    WHEN 3.
      MESSAGE e888(sabapdocu) WITH text-006. "Error displaying status icon
  ENDCASE.
ENDMODULE.
MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.
MODULE change.
  CASE value.
    WHEN 1.
      value = 2.
    WHEN 2.
      value = 3.
    WHEN 3.
      value = 1.
  ENDCASE.
ENDMODULE.
62)sy-repid  = to get the Report Program name.
63)To call sub screens:
MODULE user_command_100 INPUT.
  CASE save_ok.
    WHEN 'SUB1'.
      number1 = '0110'.
    WHEN 'SUB2'.
      number1 = '0120'.
      CLEAR field1.
    WHEN 'SUB3'.
      number2 = '0130'.
    WHEN 'SUB4'.
      number2 = '0140'.
      CLEAR field2.
  ENDCASE.
ENDMODULE.
64)Dynamic Dictionary referance:
DATA name(20) TYPE c.
SELECTION-SCREEN BEGIN OF SCREEN 500.
PARAMETERS p_carr LIKE (name).
SELECTION-SCREEN END OF SCREEN 500.
name = 'SPFLI-CARRID'.
CALL SELECTION-SCREEN 500.
65)SPA/GPA Parameters as Default :
PARAMETERS test(16) TYPE c MEMORY ID rid.
66)Default Values : select-option default values:
DATA wa_spfli TYPE spfli.
SELECT-OPTIONS airline FOR wa_spfli-carrid
               DEFAULT 'AA'
                    TO 'LH'
                OPTION  nb
                  SIGN  i.
67)Restricting Input to One Line
SELECT-OPTIONS airline FOR wa_spfli-carrid NO-EXTENSION.
68)Restricting Input to Single Fields
SELECT-OPTIONS airline FOR wa_spfli-carrid NO INTERVALS.
69)Single Field and Single Line
SELECT-OPTIONS airline FOR wa_spfli-carrid NO INTERVALS
                                           NO-EXTENSION.
70)Selection screen:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) text-001.
PARAMETERS: p1(3) TYPE c, p2(5) TYPE c, p3(1) TYPE c.
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS airline FOR wa_spfli-carrid.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION pos_high.
PARAMETERS field(5) TYPE c.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK rad1
                          WITH FRAME TITLE text-002.
PARAMETERS r1 RADIOBUTTON GROUP gr1.
PARAMETERS r2 RADIOBUTTON GROUP gr1.
PARAMETERS r3 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK rad1.
71)SELECTION-SCREEN:
  BEGIN OF SCREEN 500 AS WINDOW TITLE tit,"------it will give title to the window.
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
      PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,
    END OF LINE,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but3 USER-COMMAND cli3,
      PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,
    END OF LINE,
  END OF SCREEN 500.
72)See ABAPDOCU-->abap userdialogs-->selection screens-->possible user actions-->pushbuttons on selection screen
TABLES sscrfields.
DATA flag(1) TYPE c.
SELECTION-SCREEN:
  BEGIN OF SCREEN 500 AS WINDOW TITLE tit,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
      PUSHBUTTON 12(10) text-020 USER-COMMAND cli2, "002--Button 2
    END OF LINE,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but3 USER-COMMAND cli3,
      PUSHBUTTON 12(10) text-040 USER-COMMAND cli4, "004--Button 4(text symbols)
    END OF LINE,
  END OF SCREEN 500.
AT SELECTION-SCREEN.
  MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm. "001--Function code:
  CASE sscrfields-ucomm.
    WHEN 'CLI1'.
      flag = '1'.
    WHEN 'CLI2'.
      flag = '2'.
    WHEN 'CLI3'.
      flag = '3'.
    WHEN 'CLI4'.
      flag = '4'.
  ENDCASE.
START-OF-SELECTION.
  tit  = 'Four Buttons'.
  but1 = 'Button 1'.
  but3 = 'Button 3'.
  CALL SELECTION-SCREEN 500 STARTING AT 10 10.
  CASE flag.
    WHEN '1'.
      WRITE / 'Button 1 was clicked'.
    WHEN '2'.
      WRITE / 'Button 2 was clicked'.
    WHEN '3'.
      WRITE / 'Button 3 was clicked'.
    WHEN '4'.
      WRITE / 'Button 4 was clicked'.
    WHEN OTHERS.
      WRITE / 'No Button was clicked'.
  ENDCASE.
73)usefull one:
TABLES sscrfields.
PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.
SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.
INITIALIZATION.
  sscrfields-functxt_01 = 'LH'.
  sscrfields-functxt_02 = 'UA'.
AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
      WHEN'FC01'.
      p_carrid = 'LH'.
      p_cityfr = 'Frankfurt'.
    WHEN 'FC02'.
      p_carrid = 'UA'.
      p_cityfr = 'Chicago'.
  ENDCASE.
START-OF-SELECTION.
  WRITE / 'START-OF-SELECTION'.
74)F1 Help on the Selection Screen :
PARAMETERS: p_carr_1 TYPE s_carr_id,
            p_carr_2 TYPE spfli-carrid.
AT SELECTION-SCREEN ON HELP-REQUEST FOR p_carr_2.
  CALL SCREEN 100 STARTING AT 10 5
                  ENDING   AT 60 10.
75)F4 Help on the Selection Screen :
PARAMETERS: p_carr_1 TYPE spfli-carrid,
            p_carr_2 TYPE spfli-carrid.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr_2.
  CALL SCREEN 100 STARTING AT 10 5
                  ENDING   AT 50 10.
76)Selection screens as subscreens :
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 1100.
77)To set the page width and page hight:
REPORT demo_list_line_count LINE-SIZE 40 LINE-COUNT 4.
78)Unconditional Page Breaks :
START-OF-SELECTION.
  DO 2 TIMES.
    WRITE / 'Loop:'.
    DO 3 TIMES.
      WRITE / sy-index.
    ENDDO.
    NEW-PAGE.
  ENDDO.
79)Scrolling a Window at a Time :(we can scrole the output)
abapuser dialogs->lists->complex list->scroling a page.
TOP-OF-PAGE.
  WRITE: 'Top of Page', sy-pagno, 'SY-SROWS:', sy-srows.
  ULINE.
START-OF-SELECTION.
  DO 100 TIMES.
    WRITE / sy-index.
  ENDDO.
  DO 3 TIMES.
    SCROLL LIST FORWARD.
  ENDDO.
80)SAP script:
Which are frequently Used System Variables in SAPscript?
&DATE& Currentdate
&DAY& Day
&MONTH& Month
&YEAR& Year
&TIME& Time of the day
&HOURS& Hours
&MINUTES& Minutes
&SECONDS& Seconds
&PAGE& Page
&NEXTPAGE& Next page number
&SPACE& Blank
&ULINE& Underline
&VLINE& Vertical line
&NAME_OF_MONTH& Name of the Month
&SAPSCRIPT-FORMPAGES& Total number of pages in currently formatted layout set
&SAPSCRIPT-JOBPAGES& Total number of pages in currently formatted print request
81)sap smartforms:
Smart Forms records page numbering using page counters. You query these using system fields
&SFSY-PAGE& for the current page number
&SFSY-FORMPAGES& for the total number of pages in the form
&SFSY-JOBPAGE& for the total number of pages of all forms in the print job
82)1) SY-DBSYS - Central Database
2) SY-HOST - Server
3) SY-OPSYS - Operating System
4) SY-SAPRL - SAP Release
5) SY-SYSID - System Name
6) SY-LANGU - User Logon Language
7) SY-MANDT - Client
 SY-UNAME - Logon User Name
9) SY-DATLO - Local Date
10) SY-DATUM - Server Date
11) SY-TIMLO - Local Time
12) SY-UZEIT - Server Time
13) SY-DYNNR - Screen Number
14) SY-REPID - Current ABAP program
15) SY-TCODE - Transaction Code
16) SY-ULINE - Horizontal Line
17) SY-VLINE - Vertical Line
18) SY-INDEX - Number of current loop Pass
19) SY-TABIX - Current line of internal table
20) SY-DBCNT - Number of table entries processed
21) SY-SUBRC - Return Code
22) SY-UCOMM - Function Code
23) SY-LINCT - Page Length of list
24) SY-LINNO - Current Line
25) SY-PAGNO - Current Page Number
26) SY-LSIND - Index of List
27) SY-MSGID - Message Class
28) SY-MSGNO - Message Number
29) SY-MSGTY - Message Type
30) SY-SPONO - Spool number during printing
83)To develop sample report through transaction:
SQVI
SQ02
GRR2

No comments:

Post a Comment