Pivot Table generation using ABAP code

Hi Friends,
              Could you please anyone help me to get the functionality of generating Pivot table in Excel from SAP.
and let me know how to use the structure EXCELPIVOT.
I am very greatful if anyone get me for this.

Hi ,
         Here is the code.
-->  p1        text
<--  p2        text
FORM fill_xxl_interface .
  xmpl_header1 = text-048.
  PERFORM fill_xmplt_o.
  PERFORM fill_xmplt_p.
  PERFORM fill_xmplt_v.                " online text
  PERFORM fill_xmplt_s.
  PERFORM fill_xmplt_h.
  PERFORM xxl_list_output.
ENDFORM.                    " fill_xxl_interface
*&      Form  fill_xmplt_o
      text
-->  p1        text
<--  p2        text
FORM fill_xmplt_o .
  DATA:
      info1(40),
      info2(40),
      ival1(60),
      ival2(60).
  info1(40) = text-049.
  info2(40) = text-050.
  WRITE sy-datum TO ival1.
  WRITE sy-uname TO ival2.
  xmplt_o-line_no    = 1.              " Text which can be displayed
  xmplt_o-info_name  = info1.          " \ online in the list viewer
  xmplt_o-info_value = ival1.          " \ is defined here.
  APPEND xmplt_o.                                           "#EC *
  xmplt_o-line_no    = 2.
  xmplt_o-info_name  = info2.
  xmplt_o-info_value = ival2.
  APPEND xmplt_o.                                           "#EC *
ENDFORM.                    " fill_xmplt_o
*&      Form  fill_xmplt_p
      text
-->  p1        text
<--  p2        text
FORM fill_xmplt_p .
  DATA:
    ptxt1(60),
    ptxt2(60),
    ptxt3(60).
  ptxt1(20) = text-051.                " SAP R/3   XXL Listviewer
  ptxt2(20) = text-052.                " Programmplanung
  WRITE sy-datum TO ptxt3.
  xmplt_p-hf         = 'H'.                                 "
  xmplt_p-lcr        = 'L'.            " left position
  xmplt_p-line_no    = 1.                                   "
  xmplt_p-text       = ptxt1.
  APPEND xmplt_p.                                           "#EC *
  xmplt_p-lcr        = 'C'.
  xmplt_p-line_no    = 2.
  xmplt_p-text       = ptxt2.
  APPEND xmplt_p.                                           "#EC *
  xmplt_p-lcr        = 'R'.
  xmplt_p-line_no    = 1.
  xmplt_p-text       = ptxt3.
  APPEND xmplt_p.                                           "#EC *
ENDFORM.                    " fill_xmplt_p
*&      Form  fill_xmplt_v
      text
-->  p1        text
<--  p2        text
FORM fill_xmplt_v .
  vtxt1 = text-004.                    " Production Line
  REPLACE ';;' WITH ' ' INTO vtxt1.
  vtxt2 = text-007.                    " Year
  REPLACE ';;' WITH ' ' INTO vtxt2.
  vtxt3 = text-024.                    " Month
  REPLACE ';;' WITH ' ' INTO vtxt3.
  vtxt4 = text-026.                    " Material
  REPLACE ';;' WITH ' ' INTO vtxt4.
  vtxt5 = text-022.                    " Material Description
  REPLACE ';;' WITH ' ' INTO vtxt5.
  vtxt6 = text-028.                    " Dosage Form
  REPLACE ';;' WITH ' ' INTO vtxt6.
  vtxt7 = text-047.                    " Dosage
  REPLACE ';;' WITH ' ' INTO vtxt7.
  vtxt8 = text-009.                    " Units per Pack
  REPLACE ';;' WITH ' ' INTO vtxt8.
  vtxt9 = text-036.                    " Manufacturing Stage
  REPLACE ';;' WITH ' ' INTO vtxt9.
  vtxt12 = text-092.                   " Order Number
  REPLACE ';;' WITH ' ' INTO vtxt12.
  vtxt13 = text-093.                   " Start Date
  REPLACE ';;' WITH ' ' INTO vtxt13.
  xmplt_v-col_no     = 1.
  xmplt_v-col_name   = vtxt1.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 2.
  xmplt_v-col_name   = vtxt2.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 3.
  xmplt_v-col_name   = vtxt3.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 4.
  xmplt_v-col_name   = vtxt4.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 5.
  xmplt_v-col_name   = vtxt5.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 6.
  xmplt_v-col_name   = vtxt6.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 7.
  xmplt_v-col_name   = vtxt7.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 8.
  xmplt_v-col_name   = vtxt8.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 9.
  xmplt_v-col_name   = vtxt9.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 10.
  xmplt_v-col_name   = vtxt12.
  APPEND xmplt_v.                                           "#EC *
  xmplt_v-col_no     = 11.
  xmplt_v-col_name   = vtxt13.
  APPEND xmplt_v.                                           "#EC *
ENDFORM.                    " fill_xmplt_v
*&      Form  fill_xmplt_s
      text
-->  p1        text
<--  p2        text
FORM fill_xmplt_s .
  DATA: n      TYPE i,                                      "#EC NEEDED
        col_no TYPE i.                                      "#EC NEEDED
  CLEAR: xmplt_s, n.
  DO n_vrt_keys TIMES.
    ADD 1 TO col_no.
    PERFORM line_xmplt_s USING col_no 'STR' 'DFT'.
  ENDDO.
  DO 6 TIMES.
    ADD 1 TO col_no.
    PERFORM line_xmplt_s USING col_no 'NUM' 'ADD'.          "CO 589334
  ENDDO.
ENDFORM.                    " fill_xmplt_s
*&      Form  LINE_XMPLT_S
      text
     -->P_COL_NO  text
     -->P_1708   text
     -->P_1709   text
FORM line_xmplt_s  USING     col_no
                            col_typ
                            col_ops.
  xmplt_s-col_no     = col_no.
  xmplt_s-col_typ    = col_typ.
  xmplt_s-col_ops    = col_ops.
  APPEND xmplt_s.                                           "#EC *
ENDFORM.                    " LINE_XMPLT_S
*&      Form  fill_xmplt_h
      text
-->  p1        text
<--  p2        text
FORM fill_xmplt_h .
  PERFORM line_xmplt_h USING 1 1 text-012.
  PERFORM line_xmplt_h USING 1 2 text-014.
  PERFORM line_xmplt_h USING 1 3 text-016.
  PERFORM line_xmplt_h USING 1 4 text-019.
  PERFORM line_xmplt_h USING 1 5 text-030.
  PERFORM line_xmplt_h USING 1 6 text-033.
ENDFORM.                    " fill_xmplt_h
*&      Form  line_xmplt_h
      text
     -->P_1      text
     -->P_1      text
     -->P_TEXT_012  text
FORM line_xmplt_h  USING     row_no col_no text.
  xmplt_h-row_no     = row_no.
  xmplt_h-col_no     = col_no.
  xmplt_h-col_name   = text.
  APPEND xmplt_h.                                           "#EC *
ENDFORM.                    " line_xmplt_h
*&      Form  xxl_list_output
      text
-->  p1        text
<--  p2        text
FORM xxl_list_output .
  DATA slines TYPE i.
  DESCRIBE TABLE xmplt_s LINES slines.
  n_att_cols = slines - n_vrt_keys.
  SORT t_final BY year month dispo.
  CALL FUNCTION 'XXL_FULL_API'                              "#EC *
    EXPORTING
      filename          = 'XXLPB001'
      header_1          = xmpl_header1
      no_dialog         = space
      n_att_cols        = n_att_cols
      n_hrz_keys        = 6
      n_vrt_keys        = n_vrt_keys
      sema_type         = ' '
    TABLES
      data              = t_final
      hkey              = xmplt_h
      online_text       = xmplt_o
      print_text        = xmplt_p
      sema              = xmplt_s
      vkey              = xmplt_v
    EXCEPTIONS
      cancelled_by_user = 1
      data_too_big      = 2
      dim_mismatch_data = 3
      dim_mismatch_sema = 4
      dim_mismatch_vkey = 5
      error_in_hkey     = 6
      error_in_sema     = 7
      file_open_error   = 8
      file_write_error  = 9
      inv_data_range    = 10
      inv_winsys        = 11
      inv_xxl           = 12
      OTHERS            = 13.
  IF sy-subrc <> 0.
  ENDIF.
ENDFORM.                    " xxl_list_output
  Data declarations for 'XXL_FULL_API'                               *
DATA: xmpl_header1 TYPE gxxlt_p-text.
DATA BEGIN OF xmplt_o OCCURS 0."#EC *     " Internal tables which shall be
        INCLUDE STRUCTURE gxxlt_o."#EC *   " \ used as input into the function
DATA END OF xmplt_o.                   " \ module's table parameters,
" \ are defined with reference to
DATA BEGIN OF xmplt_p OCCURS 0."#EC *    " \ the appropriate DD structures.
        INCLUDE STRUCTURE gxxlt_p.                          "#EC *
DATA END OF xmplt_p.
DATA BEGIN OF xmplt_h OCCURS 0.                             "#EC *
        INCLUDE STRUCTURE gxxlt_h.                          "#EC *
DATA END OF xmplt_h.
DATA BEGIN OF xmplt_v OCCURS 0.                             "#EC *
        INCLUDE STRUCTURE gxxlt_v.                          "#EC *
DATA END OF xmplt_v.
DATA BEGIN OF xmplt_s OCCURS 0.                             "#EC *
        INCLUDE STRUCTURE gxxlt_s.                          "#EC *
DATA END OF xmplt_s.
DATA: n_att_cols TYPE i,
      n_vrt_keys TYPE i VALUE '11'.

Similar Messages

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • How to transfer data in change log table of dso to z-table using abap code

    Hi  can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept

    PROGRAM NAME:   ZBW_DELTA_TO_GSTAR                                 **
    report ZBW_DELTA_TO_GSTAR no standard page heading
                                     line-size 120
                                     line-count 75
                                     message-id ZBW_MSG_CLS.
    tables:   ZGIV_DLTA_EBV_BB,
              ZGIV_DLTA_EM2_BL,
              ZGIV_DLTA_EM2_BK.
    Selection Screen Definitions
    SELECTION-SCREEN: BEGIN OF BLOCK INNER WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN: SKIP 1.
    PARAMETERS:       EBVBB RADIOBUTTON GROUP ROLL,
                      EM2BL RADIOBUTTON GROUP ROLL,
                      EM2BK RADIOBUTTON GROUP ROLL.
    SELECTION-SCREEN: END OF BLOCK INNER.
    Data:  WS_UPDATE_FLAG  Type C,
           UCounter(9)      Type N,
           ICounter(9)      Type N.
    DATA:  T_ZGIV_DLTA_EBV_BB Type Standard Table of ZGIV_DLTA_EBV_BB,
           s_ZGIV_DLTA_EBV_BB LIKE line of T_ZGIV_DLTA_EBV_BB.
    DATA:  T_ZGIV_DLTA_EM2_BK Type Standard Table of ZGIV_DLTA_EM2_BK,
           s_ZGIV_DLTA_EM2_BK LIKE line of T_ZGIV_DLTA_EM2_BK.
    DATA:  T_ZGIV_DLTA_EM2_BL Type Standard Table of ZGIV_DLTA_EM2_BL,
           s_ZGIV_DLTA_EM2_BL LIKE line of T_ZGIV_DLTA_EM2_BL.
    Standard Internal Tables - Describe usage.
    data: begin of i_AEPSD_O0140 occurs 0.
            include structure /BIC/AEPSD_O0140.
    data: end of i_AEPSD_O0140.
    data: begin of i_AEPSD_O0240 occurs 0.
            include structure /BIC/AEPSD_O0240.
    data: end of i_AEPSD_O0240.
    data: begin of i_AEPSD_O0340 occurs 0.
            include structure /BIC/AEPSD_O0340.
    data: end of i_AEPSD_O0340.
    data: begin of i_GIV_DLTA_EBV_BB occurs 0.
            include structure ZGIV_DLTA_EBV_BB.
    data: end of i_GIV_DLTA_EBV_BB.
    data: begin of i_GIV_DLTA_EM2_BK occurs 0.
            include structure ZGIV_DLTA_EM2_BK.
    data: end of i_GIV_DLTA_EM2_BK.
    data: begin of i_GIV_DLTA_EM2_BL occurs 0.
            include structure ZGIV_DLTA_EM2_BL.
    data: end of i_GIV_DLTA_EM2_BL.
    Miscellaneous Program Variables and Constants.
    TOP-OF-PAGE
    top-of-page.
    START-OF-SELECTION
    start-of-selection.
      Clear: i_GIV_DLTA_EBV_BB,
             i_GIV_DLTA_EM2_BK,
             i_GIV_DLTA_EM2_BL,
             UCounter, ICounter.
      IF EBVBB = 'X'.
        PERFORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      ELSEIF EM2BK = 'X'.
        PERFORM 100_EXTRACT_EM2_BK_DELTA_RECS.
      ELSE.
        PERFORM 100_EXTRACT_EM2_BL_DELTA_RECS.
      ENDIF.
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      Refresh:   i_AEPSD_O0140,
                 i_GIV_DLTA_EBV_BB.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EBV_BB .
      Select * From /BIC/AEPSD_O0140
        Into TABLE i_AEPSD_O0140.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0140.
          MOVE-CORRESPONDING i_AEPSD_O0140 TO s_ZGIV_DLTA_EBV_BB.
          MOVE SY-DATUM to s_ZGIV_DLTA_EBV_BB-create_dt.
          INSERT ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EBV_BB FROM  s_ZGIV_DLTA_EBV_BB.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS.
    Refresh:   i_AEPSD_O0240,
               i_GIV_DLTA_EM2_BK.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BK .
      Select * From /BIC/AEPSD_O0240
        Into TABLE i_AEPSD_O0240.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0240.
          MOVE-CORRESPONDING i_AEPSD_O0240 TO s_ZGIV_DLTA_EM2_BK.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BK-create_dt.
            INSERT ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BK FROM  s_ZGIV_DLTA_EM2_BK.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS.
    Refresh:   i_AEPSD_O0340,
               i_GIV_DLTA_EM2_BL.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BL .
      Select * From /BIC/AEPSD_O0340
        Into TABLE i_AEPSD_O0340.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0340.
          MOVE-CORRESPONDING i_AEPSD_O0340 TO s_ZGIV_DLTA_EM2_BL.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BL-create_dt.
            INSERT ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BL FROM  s_ZGIV_DLTA_EM2_BL.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BL_DELTA_RECS
    END-OF-SELECTION
    end-of-selection.
      perform D1000_REPORT_DATA.
    D1000_REPORT_DATA
    form D1000_REPORT_DATA.
    *Display the title of the program
      write: /25 SY-TITLE.
      skip.
    Diaplay the details of the user and time
      write: /1 'Executed by', 15 SY-UNAME, 30 'Date',
      38 SY-DATUM, 53 'Time', 60 SY-UZEIT.
      skip 2.
      write: /  'Delta Records have been extracted  ',
             /   'Updates : ', UCounter,
             /   'Inserts : ', ICounter.
      skip.
      skip 3.
      write: /20 'End of the report'.
    endform.                                           "D1000_REPORT_DATA
    chgeck it out this also may hep you

  • Creating a long text using ABAP code.. fm SAVE_TEXT

    When you create an order via IW31 one of the options is to click on the text button and create a long text. I am basically trying to mimic this action from within my ABAP code.
    The text id details are as follows:
    Text Name       500000015000046  which is (5000000 + order number)
    Language        EN
    Text ID            KOPF         Order header text
    Text Object      AUFK       Order text
    If i manually create the text within the transaction i am then able to view and update it via function modules READ_TEXT and SAVE_TEXT. But if the text has not already been created READ_TEXT obviously returns nothing as it does not exist and SAVE_TEXT does not seem to created it!
    Anyone know how i would go about creating this text using ABAP code?
    Hope this make a bit of sense
    Thanks in advance
    Mart

    I have implemented the code as i think it should be. See below, can any see what is wrong. If i add init_text it makes no difference and adding the commit_text just makes it hang
    DATA: IT_TEXTS type standard table of TLINE,
           wa_texts like line of it_texts,
           wa_txtheader type THEAD.
    wa_txtheader-TDID     = 'KOPF'.
    wa_txtheader-TDSPRAS  = 'EN'.
    wa_txtheader-TDNAME   = '500000015000056'.
    wa_txtheader-TDOBJECT = 'AUFK'.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
      wa_texts-tdformat = '*'.
    wa_texts-tdline = 'hello'.
    append wa_texts to it_texts.
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        CLIENT                = SY-MANDT
        HEADER                = wa_txtheader
        INSERT                = 'X'
       SAVEMODE_DIRECT       = ' '
       OWNER_SPECIFIED       = 'X'
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
      TABLES
        LINES                 = IT_TEXTS
    EXCEPTIONS
       ID                    = 1
       LANGUAGE              = 2
       NAME                  = 3
       OBJECT                = 4
       OTHERS                = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Changing Field Label length for Data Element using ABAP code.

    Hi Experts,
    We have a scenario where we have to update the maximum length of the various Field Labels (Short, Medium, Long..) for a Data Element using ABAP code.
    Does anyone know how to do this ? Is there a Function Module available for this purpose ?
    Appreciate your valuable inputs.

    Hi ,
    Use the view
    DD03M
    Give
    TABNAME as table name,
    DDLANGUAGE = EN / sy-langu
    and order by position. (for correct sequencing)
    You will get description of the fields (short,medium, long etc). You will also get the length and other details.

  • Create new survey data for opportunity using abap code

    Hello to all,
    I have one requirement.
    create survey data for given opportunity ID using abap code. or copy survey data from one opportunity to another opportunity using abap.
    any ideas..
    many thanks
    Babu

    Hello Babu,
    You can do this through the CRM_ORDER_MAINTAIN FM, this is the generic FM to edit any transaction in CRM.
    The FM contains an internal table IT_SURVEY that must be filled. Actually, this table will only contain a reference to the (completed) survey, it doesn't store the data of the survey itself.
    For some example coding, take a look at the SrvTSurvey.do controller. If you want to see what data is stored in the IT_SURVEY table, create a transaction and attach a completed survey to it (you can easily do it in the standard views of the webclient) and take a look at the survey structure in the CRM_ORDER_READ FM/Report.
    Let me know if you need more guidance,
    Reward points if useful,
    Regards,
    Joost

  • Improve data load performance using ABAP code

    Hi all,
             I want to improve my load performance using ABAP code, how to do this?. If i writing ABAP code in SE38 how i can call
    in BW side? if give sample code to improve load performance it will be usefull. please guide me.

    There are several points that can improve performance of your ABAP code:
    1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
    2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
    3. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
    4.Avoid using nested SELECT and SELECT statements within LOOPs.
    5. Avoid using INTO CORRESPONDING FIELDS OF. Instead use INTO TABLE.
    6. Avoid using SELECT * and select only the required fields from the table.
    7. Avoid Executing a SELECT multiple times in the program.
    8. Avoid nested loops when working with large internal tables.
    9.Whenever using READ TABLE use BINARY SEARCH addition to speed up the search.
    10. Use FIELD-SYMBOLS instead of a work area when there are more than 200 entries in an internal table where some fields are being manipulated.
    11. Use MOVE with individual variable/field moves instead of MOVE-CORRESPONDING.
    12. Use CASE instead of IF/ENDIF whenever possible.
    13. Runtime transaction code se30 can be used to measure the application performance.
    14. Transaction code st05 can be used to analyse the SQL trace and measure the performance of the select statements of the program.
    15. Start routines can be used when transformation is needed in the data package level. Field/individual routines can be used for a simple formula or calculation. End routines are used when you wish to populate data not present in the source but present in the target.
    16. Always use a WHERE clause for DELETE statement. To delete records for multiple values, use SELECT-OPTIONS.
    17. Always use 'IS INITIAL' instead of equal to '' because null for a character is '' but '0' for an integer.
    Hope it helps.

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How to Use CMOD and SMOD in SAP using ABAP Code

    Hello anyone,
      Please help me How to use CMOD and SMOD in SAP using ABAP code.
    Give Me Some Sample Example.
    Mail ID: [email protected]
    Thanks,
    Regards,
    S.Muthu,
    SAP Developer.

    Hi,
    User Exits.
    http://www.erpgenie.com/sap/abap/code/abap26.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    customer exits
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Menu Exit.
    http://www.sappoint.com/abap/spmp.pdf
    http://www.sappoint.com/abap/userexit.pdf
    http://www.sapdevelopment.co.uk/enhance/mod_sapmenu.htm
    http://www.sapdevelopment.co.uk/enhance/enhancehome.htm
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

  • How to get pivot table by using dates

    Hi,
    How to get pivot table by using dates in column.
    Below is the sample table and its value is given.
    create table sample1
    Order_DATE       DATE,
    order_CODE       NUMBER,
    Order_COUNT   NUMBER
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,232);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,935);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,43);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,5713);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,11346);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,368);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,1380);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,133);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,7109);
    Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,14336);
    select * from sample1;So how to get the data like below.
              order_date
    order_code 30-sep-12 29-sep-12
    1 232 368
    2 935 1380
    3 43 133
    4 5713 7109
    5 11345 14336

    Using the extra data I inserted in my previous reply:select ORDER_CODE,
    SUM(DECODE(extract (month from ORDER_DATE),1,ORDER_COUNT,0)) JAN,
    SUM(DECODE(extract (month from ORDER_DATE),2,ORDER_COUNT,0)) FEB,
    SUM(DECODE(extract (month from ORDER_DATE),3,ORDER_COUNT,0)) MAR,
    SUM(DECODE(extract (month from ORDER_DATE),4,ORDER_COUNT,0)) APR,
    SUM(DECODE(extract (month from ORDER_DATE),5,ORDER_COUNT,0)) MAY,
    SUM(DECODE(extract (month from ORDER_DATE),6,ORDER_COUNT,0)) JUN,
    SUM(DECODE(extract (month from ORDER_DATE),7,ORDER_COUNT,0)) JUL,
    SUM(DECODE(extract (month from ORDER_DATE),8,ORDER_COUNT,0)) AUG,
    SUM(DECODE(extract (month from ORDER_DATE),9,ORDER_COUNT,0)) SEP,
    SUM(DECODE(extract (month from ORDER_DATE),10,ORDER_COUNT,0)) OCT,
    SUM(DECODE(extract (month from ORDER_DATE),11,ORDER_COUNT,0)) NOV,
    SUM(DECODE(extract (month from ORDER_DATE),12,ORDER_COUNT,0)) DEC
    from SAMPLE1
    where trunc(order_date, 'YY') = trunc(sysdate, 'YY')
    group by order_code
    order by order_code;
    ORDER_CODE JAN FEB MAR APR MAY JUN JUL AUG   SEP   OCT NOV DEC
             1   0   0   0   0   0   0   0   0   600   600   0   0
             2   0   0   0   0   0   0   0   0  2315  2315   0   0
             3   0   0   0   0   0   0   0   0   176   176   0   0
             4   0   0   0   0   0   0   0   0 12822 12822   0   0
             5   0   0   0   0   0   0   0   0 25682 25682   0   0Now a bit of explanation.
    1) Whenever you pivot rows to columns, no matter what version of Oracle and no matter what method you use, you have to decide in advance how many columns you are going to have and what the names of the columns are. This is a requirement of the SQL standard.
    2) I use the WHERE clause to get just the data for this year
    3) With EXTRACT, I get just the month without the year.
    4) Using DECODE, I put every month's data into the correct column
    5) Once I do all that, I can just GROUP BY order_code while SUMming all the data for each month.

  • Change Prg name in classes using abap code

    Hello Experts,
    I'm having following req:-
    I need to change program name using abap code .
    I have prepared report which changing prg name & also it is replecting target name into T-code & Programes where source prg name is being used.
    My next req is i want to replace sorce prg name in Classes usinf abap coding.
    <Priority normalized by moderator>
    Thanxs in Advance.
    Moderator message : Requirements dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Feb 7, 2012 12:32 PM

    The application name is not necessarily uniqueue! Customers may create two applications with same name in different systems/clients and transport them into the same target system/client!
    You do the mapping with the query:
    CL_FDT_FACTORY=>GET_INSTANCE( )->GET_QUERY()->...
    There are two methods. One for mapping ID to name and one for name to ID.
    There is also a sample report in package SFDT_DEMO_OBJECTS.

  • How to bypass printer setting using abap code?

    Dear All,
    I want to bypass printer setting using abap code?
    I am printing sticker using a code and i dont want to display printer setting .
    I want direct ouput ?
    Regards
    Steve

    Are you using reports or scripts/smart forms? You can use the parameter for no_dialog = space(use the relevant parameter).

  • Setting value in a cookie using ABAP code

    Hai All,
    Using ABAP code is it possible to set some value in a cookie.
    Regards,
    H.K.Hayath Basha.

    Hai Durairaj,
    Can you explain how to do that.
    Regards,
    H.K.Hayath Basha.

  • Setting value in cookie using ABAP code

    Hai All,
    Is it possible to set value in a cookie using ABAP code.
    Regards,
    H.K.Hayath Basha.

    Hai Thomas Jung,
    In Enterprise portal SAP has standard functionality to set inactivity timeout. We can set whatever time we want, say for example if we set the time as 15 minutes. If the user is not interacting with the system for 15 minutes then portal will logout the user automatically without any information.
    Our user wants a popup to be shown that the system will be logged out due to inactivity.
    Since Portal logout the user automatically without any information. I want to put in my own framework to handle inactivity timeout.
    What idea I have is, when ever user interacts with any function in portal. I will set current time in a cookie. Someother application will read this cookie at regular interval, if the time difference between the cookie and system is 15, then I will force the user to logout by showing a popup screen.
    In our portal we have three different type of application, they are, Java Webdynpro, ABAP-Webdynpro and BSP.
    I think that from Java Webdynpro and BSP we can call a javascript to set value in a cookie, from ABAP-Webdynpro I don't know how to set a value in cookie.
    This is my business requirement. Is there anyother solution to fullfill this business requirement.
    Thanks & Regards,
    H.K.Hayath Basha.
    Let me tell the business requirement.  Our user want to give a popup message when

  • Trigger Process chain using ABAP code

    Hi All,
    As per my knowledge there are 2 ways to trigger a process chain using ABAP code :
    1) Using FM ‘RSPC_API_CHAIN_START’ and passing process chain name as the parameter
    2)Using FM 'BP_EVENT_RAISE' and passing process event as the parameter, which you can create using SM62 transaction.
    I would like to know which one is better to use, in terms of advantage and disadvantage.
    Thanks,
    Praveena

    Hi praveena,
    check these links ..u .may get some help
    Process Chain
    Process Chain
    How to run a Process Chain
    Process chain-parallel process
    Regards
    BILL

Maybe you are looking for

  • "Unable to load data" error after Windows update

    Hi all, I've been maintaining a LightSwitch desktop app for a couple of years now.  The app runs on a server and several client machines access it.  Sometime in the last few months, any client that has Windows Update enabled has failed to load data.

  • How to get Portal Login User and Its Related BP in CRM?

    Hi, An ABAP Webdynpro program is called in CRM from Portal user by a portal link. How to get the user ID and its related BP in CRM? Thanks! The portal is integrated with ECC, and all users and BPs are maintained in ECC then replicated to CRM. Best re

  • CSS initialization error

    Whenever I boot up I get an error message that says  "the CSS.exe initialisaion process could not operate on this occasion" plus the Rescue and Recovery backup process fails each week.  Any ideas?  Ive gone into the R&R and client security solution p

  • Adding Path corrupts PS3 file!

    Hi, I've just started getting a problem which results in a totally corrupt PSD file. If I add a path (say I'm doing a clipping path around some people) I can get so far then if I close the file I cannot open it again "Could not complete your request

  • Migrate, restore from Time Machine or fresh install

    Folks Getting an MBP today and migrating from MBA. Should I fresh install, use the migrate tool or restore from Time Machine?