Clear Heads Prevail

I can use a few level heads to help me think through a mess we're in.
When my wife came home from work yesterday, she found we were broken into and robbed. Pertinent here is that gone are:
G5 iMac, which would had to have been unplugged.
Intel Macbook, original Black, in sleep mode.
G4 Powerbook, in sleep mode.
iPod Touch.
All three machines authorized for iTunes and password protected, only at boot up.
Hundreds of songs purchased.
They left my backup drive, partitioned and cloned to the three, but no power supply/cord to power it at the moment.
My mind is awash in passwords, credit cards, online banking, 401's, brokerage accounts.
Any advice is welcomed, especially in the order things need to be done.
From my new 13" Macbook Pro, purchased last night to get started.
TIA,
Joe

jouu,
First of all, my sympathies for your situation. It is incredibly stressful to be so violated.
I would suggest the following courses of action:
1) Contact your banks, credit card issuers and other financial institutions and change passwords for those accounts.
2) Contact your local law enforcement agency. You are going to need serial numbers of all the hardware involved to assist them.
3) Contact Apple iTunes support and have your password changed there so that no unauthorized purchases can be made to your account.
4) Contact your homeowners/renters insurance company to find out what coverage you have for this incident.
Restore your data from backup. If you do not have backups of your iTunes songs/videos/etc, you may be able to contact Apple's iTunes support and ask them to allow you to download them again. Normally your purchase of these things only allows you to download them once, but Apple has been known to allow exceptions in cases such as yours. Note that Apple has to pay royalties for each download, whether paid for or free.
5) Take a deep breath and give thanks that it is only material things that were taken.
Best of luck.

Similar Messages

  • Clear Header in ALV

    Hi All
      i want clear header when i excute report header displyed after when i go back header displaying agian not clearing header info,,when i go back i need to come out this programe now header displaying , now its 2 times i am gng back, pls if any one knws where should i clear that header i dont want to display again when i go back immediately need to go out of the program.
    My code:
    FORM TOP-OF-PAGE.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = ' HR Master Data Records'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      sort it_pa0001 by pernr.
      describe table IT_PA0001 lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.

    Hi
    One question when you say going back u are coming to the selection screen or u want to be on the same screen.
    Try to clear t_header at different places and check u r self.
    Hope it helps.
    Thanks,
    chaithanya.

  • How to put header and how to insert logo in this report

    HI
    I want  a header and logo in this report.how to do this in ALV report.Also why we have to put the          sy-repid.Plz tell me in this report where i have to do all this.Plz show me in detail.
    REPORT  ZREPORT_ALV .
    TYPE-POOLS : slis.
    tables:vbak,vbap.
    *DATA:  report_id LIKE sy-repid.
    DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV.
    data: ivariant(1) type c,
          itvariant like disvariant,
          w_variant like disvariant.
    initialization.
    *REPORT_ID = SY-REPID.
    PERFORM F1000_LAYOUT_INIT. "using I_LAYOUT.
    ivariant = 'A'.
    itvariant = w_variant.
    select-options:so_vbeln for vbap-vbeln.
    data:itab like vbak occurs 0 with header line.
    data:itab1 like vbap occurs 0 with header line.
    start-of-selection.
    select * from vbak into table itab where vbeln in so_vbeln.
    if not itab[] is initial.
    select * from vbap into table itab1
    for all entries in itab
    where vbeln = itab-vbeln.
    endif.
    data:ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat1  TYPE slis_t_fieldcat_alv.
    ****For alv display
    IF NOT itab1[] IS INITIAL.
       DEFINE ls_fieldcat.
       add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname    = &1.
        ls_fieldcat-outputlen    = &2.
        ls_fieldcat-seltext_l    = &3.
         ls_fieldcat-emphasize  = &4.
        append ls_fieldcat to lt_fieldcat1.
        clear ls_fieldcat.
      END-OF-DEFINITION.
        ls_fieldcat 'VBELN'           '10'     'Sales Order Number'.
       ls_fieldcat 'POSNR'           '6'        'SO Item'.
        ls_fieldcat 'MATNR'           '13'      'Material No'.
    m_fieldcat1 'NETWR'           '13'        'Amount'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = 'wf_report'
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         =  I_LAYOUT
       IT_FIELDCAT                       =  lt_fieldcat1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =   ITVARIANT
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          =  itab1
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endif.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
       I_SAVE              = ivariant
      CHANGING
       CS_VARIANT          = itvariant
    EXCEPTIONS
      WRONG_INPUT         = 1
      NOT_FOUND           = 2
      PROGRAM_ERROR       = 3
      OTHERS              = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM F1000_LAYOUT_INIT. "USING I_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *CLEAR I_LAYOUT.
    i_layout-colwidth_optimize = 'X'.
    I_LAYOUT-key_hotspot = u2018Xu2019.
    I_LAYOUT-hotspot_fieldname =  MATNR.
    ENDFORM.

    hi,,,,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = sy-repid >>>>>>>>>>>>> your report name.
    regarding logo and header,,,,
    first store the logo in T-code OAOR, then call that in your report.......
    data: heading        TYPE slis_t_listheader,
          wa_header      TYPE slis_listheader,
         events         TYPE slis_t_event.
    * To display TOP_OF_PAGE.
    FORM top_of_page.
      DATA : text(40),txtdt(40).
      CLEAR l_string.
      l_string = 'JCB India Limited'(hd2).
      wa_header-typ  = 'H'.
      wa_header-info = l_string.
      APPEND wa_header TO heading.                              " index 1.
      CLEAR l_string.
      WRITE :'Number of records:' TO text,dbcnt TO text+20 LEFT-JUSTIFIED.
      wa_header-typ  = 'S'.
      wa_header-info = text.
      APPEND wa_header TO heading.
      CLEAR l_string.
      wa_header-typ  = 'S'.
      WRITE : 'Report Run Date  :' TO txtdt,sy-datum TO txtdt+20 DD/MM/YY.
      WRITE sy-datum TO dat DD/MM/YY.
      wa_header-info = txtdt.
      APPEND wa_header TO heading.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          i_logo             = 'ENJOYSAP_LOGO'
          it_list_commentary = heading.
      CLEAR heading.
    ENDFORM.                    "top_of_page
    to execute top-of-page you have to create events.
    for ex......
    FORM create_event USING p_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_events.
      READ TABLE p_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE formname_top_of_page TO ls_event-form.
        APPEND ls_event TO p_events.
      ENDIF.
    ENDFORM.                    " create_event

  • How to get header in the ALV report

    Hi
    I want to print header in the ALV report.But i am not getting that.Plz see my program it is getting error and also not printing header.If there is any error means plz give me the solution.In this program there is an error.
    REPORT  ZREPORT_ALV .
    TYPE-POOLS : slis.
    tables:vbak,vbap.
    DATA:  report_id LIKE sy-repid.
    DATA: I_LAYOUT TYPE SLIS_LAYOUT_ALV.
    data: heading        TYPE slis_t_listheader,
          wa_header      TYPE slis_listheader,
         events         TYPE slis_t_event.
    data: l_string type c.
    data: ivariant(1) type c,
          itvariant like disvariant,
          w_variant like disvariant.
    initialization.
    REPORT_ID = SY-REPID.
    PERFORM pgm. "F1000_LAYOUT_INIT. "using I_LAYOUT.
    ivariant = 'A'.
    *PERFORM init.
    itvariant = w_variant.
    select-options:so_vbeln for vbap-vbeln.
    data:itab like vbak occurs 0 with header line.
    data:itab1 like vbap occurs 0 with header line.
    start-of-selection.
    select * from vbak into table itab where vbeln in so_vbeln.
    if not itab[] is initial.
    select * from vbap into table itab1
    for all entries in itab
    where vbeln = itab-vbeln.
    endif.
    data:ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat1  TYPE slis_t_fieldcat_alv.
    ****For alv display
    IF NOT itab1[] IS INITIAL.
       DEFINE ls_fieldcat.
       add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname    = &1.
        ls_fieldcat-outputlen    = &2.
        ls_fieldcat-seltext_l    = &3.
         ls_fieldcat-emphasize  = &4.
        append ls_fieldcat to lt_fieldcat1.
        clear ls_fieldcat.
      END-OF-DEFINITION.
        ls_fieldcat 'VBELN'           '10'     'Sales Order Number'.
       ls_fieldcat 'POSNR'           '6'        'SO Item'.
        ls_fieldcat 'MATNR'           '13'      'Material No'.
    m_fieldcat1 'NETWR'           '13'        'Amount'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         =  I_LAYOUT
       IT_FIELDCAT                       =  lt_fieldcat1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =   ITVARIANT
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          =  itab1
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endif.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
       I_SAVE              = ivariant
      CHANGING
       CS_VARIANT          = itvariant
    EXCEPTIONS
      WRONG_INPUT         = 1
      NOT_FOUND           = 2
      PROGRAM_ERROR       = 3
      OTHERS              = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM  pgm. "F1000_LAYOUT_INIT. "USING I_LAYOUT TYPE SLIS_LAYOUT_ALV.
    CLEAR I_LAYOUT.
    i_layout-colwidth_optimize = 'X'.
    I_LAYOUT-key_hotspot = u2018Xu2019.
    I_LAYOUT-hotspot_fieldname =  MATNR.
    ENDFORM.
    *regarding logo and header,,,,
    *first store the logo in T-code OAOR, then call that in your report.....
    *data: heading        TYPE slis_t_listheader,
         wa_header      TYPE slis_listheader,
        events         TYPE slis_t_event.
    To display TOP_OF_PAGE.
    FORM top_of_page.
      DATA : text(40),txtdt(40).
      CLEAR l_string.
      l_string = 'JCB India Limited'(hd2).
      wa_header-typ  = 'H'.
      wa_header-info = l_string.
      APPEND wa_header TO heading.                              " index 1.
      CLEAR l_string.
      WRITE :'Number of records:' TO text,'dbcnt' TO text+20 LEFT-JUSTIFIED.
      wa_header-typ  = 'S'.
      wa_header-info = text.
      APPEND wa_header TO heading.
    CLEAR l_string.
    wa_header-typ  = 'S'.
    WRITE : 'Report Run Date  :' TO txtdt,sy-datum TO txtdt+20 DD/MM/YY.
    WRITE sy-datum TO dat DD/MM/YY.
    wa_header-info = txtdt.
    APPEND wa_header TO heading.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
         i_logo             = 'ENJOYSAP_LOGO'
          it_list_commentary = heading.
      CLEAR heading.
    ENDFORM.                    "top_of_page
    *to execute top-of-page you have to create events.
    *for ex......
    FORM create_event USING p_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_events.
      READ TABLE p_events WITH KEY name = slis_ev_top_of_page
                             INTO ls_event.
      IF sy-subrc = 0.
        MOVE formname_top_of_page TO ls_event-form.
        APPEND ls_event TO p_events.
      ENDIF.
    ENDFORM.                    " create_event

    Hi,
       Find below code for your question, you may get some idea,,
    *& Report  ZACTIONGRIDPRACTICE
    REPORT  ZACTIONGRIDPRACTICE.
    *data declarations.....
    TYPE-POOLS SLIS.
    TABLES : T529T ,PA0000.
    data : gd_repid type  sy-repid.
    DATA : LD_COLOR(10) TYPE N.
    DATA : GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV.
    Data:  is_fieldcat TYPE slis_fieldcat_alv.
    DATA : GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA : GD_DATUM TYPE DATUM.
    DATA : BEGIN OF WA_TABLE,
                    MASSN TYPE T529T-MASSN,
                    MNTXT TYPE T529T-MNTXT,
                    userg type userg,
                    TOTAL TYPE I ,
                    begda type begda,
                    endda type endda,
                    april type i,
                    SLNO TYPE I,
                      LINE_COLOR(4) TYPE C,
                    END OF WA_TABLE,
                    IT_TABLE LIKE TABLE OF WA_TABLE.
    data : april type i.
    DATA : TEMP TYPE C.
    data :    LT_PA0000 TYPE TABLE OF PA0000,
              LT_PA0000_T typE TABLE OF PA0000 with header line.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
            WA_FCAT LIKE LINE OF IT_FCAT.
    DATA : IT_EVENTS TYPE SLIS_T_EVENT,
            WA_EVENTS LIKE LINE OF IT_EVENTS.
            wa_events-form = 'HEADER'.
    WA_EVENTS-NAME = 'TOP_OF_PAGE'.
    APPEND WA_EVENTS TO IT_EVENTS.
    PERFORM HEADER.
    DATA : SLNO TYPE I.
    DATA : lv_output      TYPE  dats.
    CALL FUNCTION 'ZHR_RE_BE_CALC_START_DATE'
      EXPORTING
        id_daberi   = sy-datum
      IMPORTING
        ed_date_cor = lv_output.
    select-options...
    selection-screen BEGIN OF BLOCK B WITH FRAME TITLE TEXT-003.
    select-options : s_date for sy-datum OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B.
    lv_output = sy-datum - 27.
    INITIALIZATION.
    S_DATE-LOW = lv_output.
    S_DATE-HIGH = SY-DATUM.
    S_DATE-SIGN = 'I'.
    S_DATE-OPTION = 'BT'.
    APPEND s_date.
    *AT SELECTION-SCREEN ON S_DATE.
    *SELECT MASSN INTO TABLE IT_TABLE FROM PA0000 WHERE BEGDA IN S_DATE.
    *SELECT STATEMENTS....
    start-of-selection.
      SELECT   t529t~MASSN t529t~MNTXT  INTO TABLE IT_table  FROM T529T where SPRSL EQ 'E' and t529t~massn in ('10','13','16','20','28','30','45','01','03') .
    DATUM IN S_DATE.
    PERFORM LAYOUT.
      loop at it_table into wa_table.
    LD_COLOR = 2.
      LD_COLOR = LD_COLOR + 1.
    if LD_COLOR = 8.
    LD_COLOR = 1.
    endif.
    concatenate 'C' '1' '11'  into wa_table-LINE_COLOR . "='C410'.
    modify it_table from wa_table.
    endloop.
      LOOP AT IT_TABLE INTO WA_TABLE." = 'C410'.
    select massn from pa0000 into table lt_pa0000 where begda in s_date and  massn = wa_table-massn.
    *write : / sy-dbcnt.  gt s_date-low and endda lt s_date-high
    *DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
    move sy-dbcnt to wa_table-total.
    READ TABLE lt_pa0000 INTO LT_PA0000_T WITH KEY MASSN = wa_TABLE-MASSN BINARY SEARCH.
    DESCRIBE TABLE LT_PA0000_t LINES LV_LINES.
    MOVE  LV_LINES to  wa_TABLE-TOTAL.
      MODIFY IT_TABLE FROM WA_TABLE.
    MOVE SY-TABIX TO WA_TABLE-SLNO.
      MODIFY IT_TABLE FROM WA_TABLE.
    REFRESH : LT_PA0000_t.
    CLEAR : LV_LINES.
      ENDLOOP.
    loop at it_table into wa_table.
    SELECT MASSN FROM PA0000 INTO TABLE lt_pa0000 where begda between '01.02.2008' and '20.02.2008'.
    MOVE SY-DBCNT TO   WA_TABLE-APRIL.
    MODIFY IT_TABLE FROM WA_TABLE.
    *endloop.
    *PERFORM STATEMENTS...
    PERFORM FCAT USING '1' 'MASSN' 'ACTIONCODE'.
    PERFORM FCAT USING '2' 'MNTXT' 'ACTION TYPE'.
    PERFORM fcat USING '3' 'TOTAL' 'TOTAL'.
    DEFINE m_fieldcat.
        is_fieldcat-fieldname = &1.
        is_fieldcat-hotspot = &2.
        is_fieldcat-seltext_m = &3.
        is_fieldcat-col_pos = &4.
        is_fieldcat-outputlen = &5.
        is_fieldcat-hotspot = &6.
        append is_fieldcat to it_fcat.
        clear is_fieldcat.
      END-OF-DEFINITION.
       m_fieldcat 'SLNO' '' Text-012 '1' '17'  ''.
      m_fieldcat 'MASSN' '' Text-010 '2' '40'  ''.
      m_fieldcat 'MNTXT'  ''  Text-009  '3' '50' ''  .
      m_fieldcat 'TOTAL'  ''  Text-011  '4' '10' 'X'.
      m_fieldcat 'april'  ''  Text-013  '5' '10' 'X'.
    *FOR DISPLAYING THE RECORDS...
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = gd_repid
      IS_LAYOUT = GD_LAYOUT
      I_CALLBACK_USER_COMMAND           = ' '
       I_GRID_TITLE                      = 'REPORT'
       IS_LAYOUT                         = gd_LAYOUT
       IT_FIELDCAT                       = IT_FCAT
       I_SAVE                            = 'X'
       IT_EVENTS                         = IT_EVENTS
      TABLES
        T_OUTTAB                          = IT_TABLE.
    **&      Form  FCAT
    *FORM FCAT  USING   FP_COL_POS
                     FP_FIELDNAME
                     FP_SELTEXT_M.
    WA_FCAT-COL_POS = FP_COL_POS.
    WA_FCAT-FIELDNAME = FP_FIELDNAME.
    wa_fcat-seltext_m = fp_seltext_m.
    APPEND WA_FCAT TO IT_FCAT.
    ENDFORM.
    *&      Form  HEADER
          text
    -->  p1        text
    <--  p2        text
    form header .
      DATA : IT_HEADER TYPE SLIS_T_LISTHEADER,
            WA_HEADER LIKE LINE OF it_header.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = 'ACTION TYPE REPORT'.
      APPEND WA_HEADER TO IT_HEADER.
      wa_header-typ  = 'S'.
      wa_header-key = Text-022.
      CONCATENATE  s_date-low+6(2) '.'
                   s_date-low+4(2) '.'
                   s_date-low(4)
                   temp
                   '.     TO      .'
                   s_date-high+6(2) '.'
                   s_date-high+4(2) '.'
                   s_date-high(4)
                   INTO wa_header-info SEPARATED BY space.
      APPEND wa_header TO it_header.
      CLEAR wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_HEADER
          I_LOGO             = 'HRRU_51050061'.
    *select single bstkd into CORRESPONDING FIELDS OF gt_vbkd
    *from vbkd where vbeln = rt_outtab-vgbel
    *and posnr = '000000'.
    *rt_outtab-bstkd = gt_vbkd-bstkd.
    ENDFORM.                    " HEADER
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
    GD_LAYOUT-NO_INPUT = ''.
    gd_layout-colwidth_optimize = ''.
    gd_layout-totals_text = 'TOTALS'(201).
    gd_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " LAYOUT

  • Urgent clearing data in container for free text

    I HAVE A CONTAINER FOR FREE TEXT.
    I HAVE A CREATE BUTTON IN MY SCREEN EWHEN I PRESS CREATE IT ASKD FOR ID AND FREE TEXT THEN I SAVE  AND IT GETS SAVED IN A ZTALE TABLE.
    WHEN AFTER SAVING IT I GO TO INITIAL SCREEN AND PRESS CREATE AGAIN THEN IT ASKS FOR ID AND IN THE CONTAINER I SEE THE FPREVIOUS TEXT.
    CAN YOU GUYS LET ME KNOW AS TO WHAT I NEED TO DO.
    I TREID CLEARING AND REFRESHING MYTABLE WHICH I HAVE USED IN THE FOLLOWING CODE.
    pbo
    if editor is initial.
    CREATE OBJECT TEXTEDIT_CUSTOM_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'TEXTEDITOR1'
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    CREATE_ERROR = 3
    LIFETIME_ERROR = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5.
    IF SY-SUBRC NE 0.
    add your handling
    ENDIF.
    CREATE OBJECT EDITOR
    EXPORTING
    PARENT = TEXTEDIT_CUSTOM_CONTAINER
    WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
    WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
    EXCEPTIONS
    OTHERS = 1.
    refresh mytable.
    call METHOD editor->SET_TOOLBAR_MODE
    EXPORTING TOOLBAR_MODE = 0.
    *call METHOD editor->SET_ENABLE
    *EXPORTING ENABLE = ' '.
    CALL METHOD editor->set_readonly_mode
    EXPORTING
    readonly_mode = 1.
    ENDIF.
    CLEAR MYTABLE.
    FREE MYTABLE.
    endif.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
    EXPORTING
    TITEL = V_REPID "--> program name
    TXT2 = SPACE
    TXT1 = 'Error in flush'.
    ENDIF.
    tHANKS
    let me know
    swathi

    For example, this program works really well with saving long text using the SAVE_TEXT function.  Here you need to create the object/id in SE75.  For this program you enter the id on the right like 999999 and enter the text on the left, execute and the text is saved, now change the id to 999998 and hit enter, notice the text is blank, now enter 999999 again, notice the text for this id has come back,  this is because the program uses READ_TEXT to retrieve the text.
    report zrich_0001.
    data:
          dockingleft  type ref to cl_gui_docking_container,
          text_editor    type ref to cl_gui_textedit,
          repid type syrepid.
    data: begin of header.
            include structure thead.
    data: end of header.
    data: begin of lines occurs 0.
            include structure tline.
    data: end of lines.
    data: textlines type table of tline-tdline,
          wa_text type tline-tdline.
    data: xthead type thead.
    parameters: p_id(10) type c.
    at selection-screen.
      if p_id is initial.
        message e001(00) with 'Enter an ID'.
      endif.
    at selection-screen output.
      repid = sy-repid.
      if dockingleft is initial.
        create object dockingleft
                    exporting repid     = repid
                              dynnr     = sy-dynnr
                              side      = dockingleft->dock_at_left
                              extension = 300.
        create object text_editor
                    exporting
                         parent     = dockingleft.
      endif.
      if p_id <> space.
        xthead-tdobject = 'ZPT_DET'.
        xthead-tdid     = 'Z001'.
        xthead-tdname = p_id.
        clear lines. refresh lines.
        call function 'READ_TEXT'
          exporting
            id                            = xthead-tdid
            language                      = sy-langu
            name                          = xthead-tdname
            object                        = xthead-tdobject
          tables
            lines                         = lines
         exceptions
           id                            = 1
           language                      = 2
           name                          = 3
           not_found                     = 4
           object                        = 5
           reference_check               = 6
           wrong_access_to_archive       = 7
           others                        = 8.
        clear textlines.
        loop at lines.
          wa_text = lines-tdline.
          append wa_text to textlines.
        endloop.
      endif.
      call method text_editor->set_text_as_r3table
         exporting
               table              = textlines
         exceptions
               others             = 1.
    start-of-selection.
      call method text_editor->get_text_as_r3table
         importing
               table              = textlines
         exceptions
               others             = 1.
    * Set SAPscript Header
      clear header.
      header-tdname =  p_id .         "Name
      header-tdobject = 'ZPT_DET'.       "Object
      header-tdid = 'Z001'.              "Id
      header-tdspras = sy-langu.
    * Move text from container to function module table
      clear  lines.  refresh lines.
      loop at textlines into wa_text .
        lines-tdline = wa_text.
        append lines .
      endloop.
      call function 'SAVE_TEXT'
           exporting
                client   = sy-mandt
                header   = header
           tables
                lines    = lines
           exceptions
                id       = 1
                language = 2
                name     = 3
                object   = 4
                others   = 5.
    Yes, this is implemented using a selection screen, but the same principals apply and this can  be easily converted to a dynpro application.
    Regards,
    Rich Heilman

  • Displaying header in excel horizontally using FM GUI_DOWNLOAD

    Dear Experts,
            I'm exporting my data to an excel file using GUI_DOWNLOAD.  The problem is that I'm having problems with exporting the headings of my excel.  I can export the heading but the problem is that it is displayed vertically and not horizontally.
    Is there a way I could display the heading horizontally?  Hope you could help me.
    Below is my program.
    DATA: BEGIN OF itab OCCURS 0,
                  DVNO TYPE ZPFHEADER-DVNO,
                  EMPNO(8),
                  EMPNAME LIKE PA0002-CNAME,
                  LTYPE LIKE it_header-wtype,
                  LCODE LIKE it_header-dkond,
                  MA(6) TYPE p DECIMALS 2,
                  APRVDATE(15),
                  DTL LIKE ZPFHEADER-DVNO,
              END OF itab.
    DATA: BEGIN OF header OCCURS 0,
                  head1(15) TYPE c,
                  head2(15) TYPE c,
              END OF header.
    PERFORM DISPLAY_DATA.
          FORM DISPLAY_DATA                                             *
    FORM DISPLAY_DATA.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              i_callback_program = g_repid
              I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
              I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
              is_layout          = gs_layout
              it_fieldcat        = gt_fieldcat[]
              it_events          = gt_events[]
            TABLES
              t_outtab           = jtab.
    ENDFORM.
    *&      FORM USER_COMMAND
          COMMAND for ALV Grid Buttons
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    PERFORM write_header.
    CASE r_ucomm.
      WHEN 'XCEL'.
        CONCATENATE: 'C:\' fname sy-datum INTO fname.
        CONCATENATE: fname '.XLS' INTO FILENAME.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME = FILENAME
            HEADER = '00'
            WRITE_FIELD_SEPARATOR = 'X'
          TABLES
            DATA_TAB   = header
            FIELDNAMES = header.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME = FILENAME
            APPEND   = 'X'
            WRITE_FIELD_SEPARATOR = 'X'
          TABLES
            DATA_TAB = jtab
          EXCEPTIONS
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION = 20
            CONTROL_FLUSH_ERROR = 21
            OTHERS = 22.
          IF sy-subrc <> 0.
          ELSEIF sy-subrc = 0.
            MESSAGE S000(38) WITH 'File ' fname 'saved in Drive C.'.
          ENDIF.
    ENDCASE.
    ENDFORM.
    *&      Form  write_header
          text
    -->  p1        text
    <--  p2        text
    FORM write_header.
    DATA: ctr(2) TYPE N.
    DO 6 TIMES.
      ADD 1 TO ctr.
      CASE ctr.
        WHEN 1. header-head1 = 'EMPLOYEE'.
                header-head2 = ' NO '.
        WHEN 2. header-head1 = 'EMPLOYEE'.
                header-head2 = ' NAME '.
        WHEN 3. header-head1 = 'LOAN'.
                header-head2 = 'TYPE'.
        WHEN 4. header-head1 = 'APPROVAL'.
                header-head2 = ' DATE '.
        WHEN 5. header-head1 = 'LOAN'.
                header-head2 = 'CODE'.
        WHEN 6. header-head1 = ' MONTHLY '.
                header-head2 = 'AMORTIZATION'.
      ENDCASE.
      APPEND header.
      CLEAR: header.
    ENDDO.
    The output should be something like this as shown below:
    Employee     Employee                     Loan     Approval     
    Number     Name                     Type     Date     
    6633     ABAD, JUSTINA     DVP1     2-Apr-07

    Hi,
    Check this sample code:
    REPORT  ZSW_DOWNLOAD_HEADER.
      DATA : itab LIKE TABLE OF t001 WITH HEADER LINE.
      SELECT * FROM t001 INTO TABLE itab.
      PERFORM mydownload TABLES itab USING 'C:\t001.txt'.
      FORM mydownload TABLES ptab USING filename.
    DAta
    *DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.
        DATA: dfies_tab LIKE dfies OCCURS 0 WITH HEADER LINE.
        DATA : allfields(300) TYPE c.
        DATA : fld(100) TYPE c.
        DATA : BEGIN OF htab OCCURS 0,
        allfields(300) TYPE c,
        END OF htab.
        CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
        tabname = 'T001'
    FIELDNAME = ' '
    LANGU = SY-LANGU
    LFIELDNAME = ' '
    ALL_TYPES = ' '
    GROUP_NAMES = ' '
    UCLEN = UCLEN
    IMPORTING
    X030L_WA = X030L_WA
    DDOBJTYPE = DDOBJTYPE
    DFIES_WA = DFIES_WA
    LINES_DESCR = LINES_DESCR
        TABLES
        dfies_tab = dfies_tab
    FIXED_VALUES = FIXED_VALUES
    EXCEPTIONS
    NOT_FOUND = 1
    INTERNAL_ERROR = 2
    OTHERS = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        LOOP AT dfies_tab.
          CONCATENATE dfies_tab-fieldtext
          cl_abap_char_utilities=>horizontal_tab INTO fld.
          CONCATENATE allfields fld INTO allfields .
        ENDLOOP.
        htab-allfields = allfields.
        APPEND htab.
    download first field list
        CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    BIN_FILESIZE =
        filename = 'c:\t001.xls'
        filetype = 'DAT'
        write_field_separator = 'X'
        TABLES
        data_tab = htab.
    then download file data
        CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    BIN_FILESIZE =
        filename = 'c:\t001.xls'
        filetype = 'DAT'
        append = 'X'
        write_field_separator = 'X'
        TABLES
        data_tab = ptab.
      ENDFORM.                    "mydownload

  • Display header for excel output using FM GUI_DOWNLOAD

    Good morning experts,
                     I've been exporting my output in excel using the FM GUI_DOWNLOAD.  The problem is, my header is not displaying.  Kindly check what I've done wrong.  Below is how I declared my header.
    DATA: BEGIN OF header OCCURS 0,
            head1(15),
            head2(15),
          END OF header.
    *&      FORM USER_COMMAND
          COMMAND for ALV Grid Buttons
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    PERFORM write_header.
    CASE r_ucomm.
      WHEN 'XCEL'.
        CONCATENATE: 'C:\' fname sy-datum INTO fname.
        CONCATENATE: fname '.XLS' INTO FILENAME.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME = FILENAME
            WRITE_FIELD_SEPARATOR = 'X'
          TABLES
            DATA_TAB = jtab
            FIELDNAMES = header
          EXCEPTIONS
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION = 20
            CONTROL_FLUSH_ERROR = 21
            OTHERS = 22.
          IF sy-subrc <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSEIF sy-subrc = 0.
            MESSAGE S000(38) WITH 'File ' fname 'saved in Drive C.'.
          ENDIF.
    ENDCASE.
    ENDFORM.
    *&      Form  write_header
          text
    -->  p1        text
    <--  p2        text
    FORM write_header.
    DATA: ctr(2) TYPE p.
    DO 6 TIMES.
      ADD 1 TO ctr.
      CASE ctr.
        WHEN 1. header-head1 = 'EMPLOYEE'.
                header-head2 = '   NO   '.
        WHEN 2. header-head1 = 'EMPLOYEE'.
                header-head2 = '  NAME  '.
        WHEN 3. header-head1 = 'LOAN'.
                header-head2 = 'TYPE'.
        WHEN 4. header-head1 = 'APPROVAL'.
                header-head2 = '  DATE  '.
        WHEN 5. header-head1 = 'LOAN'.
                header-head2 = 'CODE'.
        WHEN 6. header-head1 = '   MONTHLY  '.
                header-head2 = 'AMORTIZATION'.
      ENDCASE.
      APPEND header.
      CLEAR: header.
    Please help me.  All helpful advice will be rewarded points.  Thanks a lot.

    Follow this Example. You can do it in the below manner
    You need not add HEADER1 HEADER2 to the internal table. You can just declare one field like below and append all the header columns to the internal table HEADER
    data : begin of IT_HEADING occurs 0,
             TEXT(15),
           end of IT_HEADING.
        IT_HEADING-TEXT = 'Company Code'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Line Item'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Line Item'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Quantity'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Unit'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Amount'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Currency'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'Job Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Quantity'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Unit'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Amount'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Currency'.
        append IT_HEADING.
        move P_FNAME to L_FNAME.
        call function 'GUI_DOWNLOAD'
          exporting
            FILENAME                = L_FNAME
            FILETYPE                = 'DAT'
          tables
            DATA_TAB                = IT_FINAL
            FIELDNAMES              = IT_HEADING
          exceptions
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION  = 20
            CONTROL_FLUSH_ERROR     = 21
            others                  = 22.
        if SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
    Regards
    Gopi

  • BAPI for F.04 (Posting with Clearing)

    Hi Experts,
    I got 2  Function Modules for F.04. T.code,
    1. BAPI_ACC_DOCUMENT_POST.
    2. BAPI_ACC_GL_POSTING_POST.
    please tell me which one is more suitable and if possible  then please provide code
    Thanks & Regards,
    Vimarsh B.

    Hi,
    Please find the code below:
    LOOP AT it_upload_rec.
        header-bus_act = 'RFBU'.
        header-doc_date = it_upload_rec-bldat.
        header-pstng_date = it_upload_rec-budat.               header-header_txt = 'F-02 Posting'.
        header-comp_code = 'PL10'.
        header-doc_type = 'SA'.
        header-username = sy-uname.
        APPEND header.
        CLEAR header.
        account_gl-itemno_acc = '1'.
        account_gl-gl_account = it_upload_rec-account1.
        APPEND account_gl.
        CLEAR account_gl.
        account_payable-itemno_acc = '2'.
        account_payable-vendor_no = it_upload_rec-account2.
        APPEND account_payable.
        CLEAR account_payable.
        currency_amount-itemno_acc = '1'.
        currency_amount-currency = 'INR'.
        currency_amount-amt_doccur = it_upload_rec-amount.
        APPEND currency_amount.
        CLEAR currency_amount.
      ENDLOOP.
      CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          documentheader          = header
    *   CUSTOMERCPD             =
    *   CONTRACTHEADER          =
       IMPORTING
      obj_type = gv_obj_type
      obj_key = gv_obj_key
      obj_sys = gv_obj_sys
        TABLES
         accountgl               = account_gl
       ACCOUNTRECEIVABLE       =
         accountpayable          = account_payable
    *   ACCOUNTTAX              =
          currencyamount          = currency_amount
    *   CRITERIA                =
    *   VALUEFIELD              =
    *   EXTENSION1              =
        return                  = it_return
    *   PAYMENTCARD             =
    *   CONTRACTITEM            =
    *   EXTENSION2              =
    *   REALESTATE              =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    KR Jaideep,

  • BAPI supporting f-30 - transfer with clearing

    I need to use f-30 ' transfer with clearing' to clear over 1000 documents at a time.
    Do you know of a BAPI in 4.7 that implements this functionality?
    Thank you
    Chris

    Hi,
    Please find the code below:
    LOOP AT it_upload_rec.
        header-bus_act = 'RFBU'.
        header-doc_date = it_upload_rec-bldat.
        header-pstng_date = it_upload_rec-budat.               header-header_txt = 'F-02 Posting'.
        header-comp_code = 'PL10'.
        header-doc_type = 'SA'.
        header-username = sy-uname.
        APPEND header.
        CLEAR header.
        account_gl-itemno_acc = '1'.
        account_gl-gl_account = it_upload_rec-account1.
        APPEND account_gl.
        CLEAR account_gl.
        account_payable-itemno_acc = '2'.
        account_payable-vendor_no = it_upload_rec-account2.
        APPEND account_payable.
        CLEAR account_payable.
        currency_amount-itemno_acc = '1'.
        currency_amount-currency = 'INR'.
        currency_amount-amt_doccur = it_upload_rec-amount.
        APPEND currency_amount.
        CLEAR currency_amount.
      ENDLOOP.
      CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          documentheader          = header
    *   CUSTOMERCPD             =
    *   CONTRACTHEADER          =
       IMPORTING
      obj_type = gv_obj_type
      obj_key = gv_obj_key
      obj_sys = gv_obj_sys
        TABLES
         accountgl               = account_gl
       ACCOUNTRECEIVABLE       =
         accountpayable          = account_payable
    *   ACCOUNTTAX              =
          currencyamount          = currency_amount
    *   CRITERIA                =
    *   VALUEFIELD              =
    *   EXTENSION1              =
        return                  = it_return
    *   PAYMENTCARD             =
    *   CONTRACTITEM            =
    *   EXTENSION2              =
    *   REALESTATE              =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    KR Jaideep,

  • User exit---to capture SO header text

    Hi all,
    Requirement is to maintain SO header texts (va02>goto>header-->texts) in a z table (i.e, acceptance numbers..like remark1, remark2,3  and 4).
    plz guide me from which structure we can capture this value..i mean runtime structure..
    I can use user-exit..MV45AFZZ--->userexit_delete_document
    or any otherwayz..?

    Hi Tuborg,
    Use Function module READ_TEXT.
    or u can follow the program.
    I think it will help u to fulfill ur requirement.
    *& Report  ZSO_TEXT_CHANGE
    REPORT  zso_text_change.
    TABLES : vbak,
             vbap,
             cfstructur.
    DATA : BEGIN OF itab OCCURS 0,
           vbeln LIKE vbak-vbeln,
           posnr LIKE vbap-posnr,
           text1(30),
           text2(30),
           text3(20),
           END OF itab.
    DATA : name LIKE stxh-tdname,
           l_tid LIKE stxh-tdid,
           obj LIKE stxh-tdid.
    *& CUSTOM CONTROL DATA DECLARATIONS
    DATA: init,
          container1 TYPE REF TO cl_gui_custom_container,
          container2 TYPE REF TO cl_gui_custom_container,
          container3 TYPE REF TO cl_gui_custom_container,
          editor1    TYPE REF TO cl_gui_textedit,
          editor2    TYPE REF TO cl_gui_textedit,
          editor3    TYPE REF TO cl_gui_textedit.
    DATA: event_tab TYPE cntl_simple_events,
          event     TYPE cntl_simple_event.
    data declarations for save long text
    TYPES: BEGIN OF type_text ,
           line(65),
    END OF type_text.
    DATA:text_tab1 TYPE STANDARD TABLE OF type_text,
         text_tab2 TYPE STANDARD TABLE OF type_text,
         text_tab3 TYPE STANDARD TABLE OF type_text,
         texttab1 LIKE LINE OF text_tab1,
         texttab2 LIKE LINE OF text_tab1,
         texttab3 LIKE LINE OF text_tab1,
                line(256) TYPE c,
                field LIKE line,
                lsel LIKE sy-lisel,
                lsel1 LIKE sy-lisel,
                lin LIKE sy-lilli,
                val(50),
                val_c(50),
                val_scr(50),
                scr_val(50),
                val1(6),
                l_posnr LIKE vbap-posnr,
                l_posnr1 LIKE vbap-posnr,
                l_text1(30),
                l_vbeln LIKE vbap-vbeln.
    DATA: textlines LIKE tline-tdline OCCURS 0.
    DATA: ls_thead LIKE thead.
    DATA: lt_tline1 LIKE TABLE OF tline WITH HEADER LINE,
          lt_tline2 LIKE TABLE OF tline WITH HEADER LINE,
          lt_tline3 LIKE TABLE OF tline WITH HEADER LINE.
    DATA BEGIN OF header OCCURS 10.
            INCLUDE STRUCTURE thead.
    DATA END OF header.
    DATA: gcontrol  LIKE cfcontrol,
            l_subrc LIKE sy-subrc.
    DATA: BEGIN OF pc_tab OCCURS 10,
            line LIKE tline-tdline,
          END OF pc_tab.
    DATA: BEGIN OF pc_tab1 OCCURS 10,
            line LIKE tline-tdline,
          END OF pc_tab1.
    DATA: long_file(23) TYPE c.
    PARAMETERS : vbeln LIKE vbak-vbeln OBLIGATORY.
    SELECT-OPTIONS : posnr FOR vbap-posnr.
    INITIALIZATION.
      CLEAR : pc_tab.
      REFRESH pc_tab.
    START-OF-SELECTION.
      SELECT vbeln posnr
      FROM vbap
      INTO TABLE itab
      WHERE vbeln = vbeln
      AND   posnr IN posnr.
    LOOP AT itab.
       itab-text1 = 'Material sales text'.
       itab-text2 = 'Technical Specifications'.
       itab-text3 = 'Packing Note'.
       MODIFY itab TRANSPORTING text1 text2 text3.
    ENDLOOP.
    END-OF-SELECTION.
      WRITE: /5 'Header Level Text' COLOR 5.
      SKIP 3.
      WRITE:  /5 'General Remarks in Amendment',
              /5 'General Specifications',
              /5 'Instructions to Accounts ',
              /5 'Instructions to Product Engg',
              /5 'Instructions to Electrical ',
              /5 'Instructions to Service  ',
              /5 'Instructions to Despatch ',
              /5 'Instructions to Works ',
              /5 'Instructions to MMD      ',
              /5 'Instructions to OED ',
              /5 'Instructions to Project Markt',
              /5 'Painting Details ',
              /5 'Docs. Reqd. for Insp. Call ',
              /5 'Docs. to be sent with Invoice ',
              /5 'Spl action plan for SO Exec',
              /5 'Spl. Inst. for record keeping ',
              /5 'Customer Comm. Address ',
              /5 'Customer Supplied Products ',
              /5 'Cust. prods/traceability reqts ',
              /5 'Qualification Tests ',
              /5 'Instrument Calib. data to Cust ',
              /5 'Test Cert. reqd. for submisn ',
              /5 'Customer Inspection Stages  ',
              /5 'Un resolved points  ',
              /5 'Regret Reason ',
              /5 'Terms of payment ',
              /5 'Additional Commercial Terms ',
              /5 'Escalation',
              /5 'Mode of Despatch Details ',
              /5 'Packing Details ',
              /5 'QAP Details ',
              /5 'Approved Transporters ',
              /5 'Eye Catch ',
              /5 'LOI Details ',
              /5 'Delivery Details ',
              /5 'Order Description ',
              /5 'Penalty / LD Clause ',
              /5 'Activity Completion Schedule ',
              /5 'Inspection Details',
              /5 'Checked By ',
              /5 'Authorised By',
              /5 'Distribution',
              /5 'Send Original&Dupl. Inv. to',
              /5 'Send Copies of Inv.&Challan to ',
              /5 'Send R/R & L/R to',
              /5 'Bankers Name & Address',
              /5 'Sales Tax Details',
              /5 'Excise Duty Details',
              /5 'CST Number & Date',
              /5 'SST Number & Date',
              /5 'Bank Charges Details',
              /5 'Price Basis Details',
              /5 'Freight Details',
              /5 'Customer Collection Details',
              /5 'Road Permit Details',
              /5 'Insurance Details'.
      SKIP 5.
      WRITE: /25 'Item Level Text' COLOR 5.
      ULINE AT /24(20).
      SKIP 3.
      LOOP AT itab.
        WRITE: /5 itab-posnr.
        l_text1 = 'Technical Specifications'.
        WRITE  : 20 l_text1.
        CLEAR l_text1.
        l_text1 = 'Material sales text'.
        WRITE  : 50 l_text1.
        CLEAR l_text1.
        l_text1 = 'Packing Note'.
        WRITE  : 80 l_text1.
        HIDE : l_text1.
      ENDLOOP.
      CLEAR itab.
    AT LINE-SELECTION.
      CLEAR : lsel, lsel1.
      REFRESH text_tab2.
      lsel = sy-lisel.
      SHIFT lsel LEFT DELETING LEADING space.
      l_posnr = lsel+0(6).
      val1 = l_posnr.
    lin = sy-lilli.
    READ LINE lin FIELD VALUE itab-text1 .
      GET CURSOR FIELD l_text1 VALUE val.
      val_c = val.
      IF l_posnr IS NOT INITIAL.
        IF val = val1.
          MESSAGE s398(00) WITH 'Select a Item text'.
        ELSE.
          PERFORM itab_text.
          CALL SCREEN 0100.
        ENDIF.
      ELSEIF l_posnr IS INITIAL.
        PERFORM read_text.
        CALL SCREEN 0100.
      ENDIF.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ZMENU'.
    SET TITLEBAR 'xxx'.
      IF l_posnr IS NOT INITIAL.
        CLEAR val_scr.
        CONCATENATE l_posnr '-' val INTO val_scr SEPARATED BY space.
        scr_val = val_scr.
      ELSE.
        scr_val = val.
      ENDIF.
      CLEAR :val_scr,l_posnr,val.
      INITIALIZING TEXT EDIT CUSTOM CONTROL
      IF init IS INITIAL.
        init = 'X'.
        CREATE OBJECT: container1 EXPORTING container_name = 'CUSTOM1',
                       editor1    EXPORTING parent = container1
    WORDWRAP SET SO THAT TEXT DOES NOT EXCEED THE INTERNAL TABLE FIELD
    *LENGTH.
    wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
    wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
    wordwrap_position = '60'
    wordwrap_to_linebreak_mode = cl_gui_textedit=>true,
                       container2 EXPORTING container_name = 'CUSTOM2',
                       editor2    EXPORTING parent = container2
    wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
    wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
    wordwrap_position = '60'
    wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
        CALL METHOD editor1->set_text_as_r3table
          EXPORTING
            table = text_tab1.
        CALL METHOD editor2->set_text_as_r3table
          EXPORTING
            table = text_tab2.
        CALL METHOD editor1->delete_text.
        CALL METHOD editor2->delete_text.
    ELSE.
       CALL METHOD editor2->delete_text.
      ENDIF.
      CALL METHOD editor1->set_text_as_r3table
        EXPORTING
          table = text_tab1.
      CALL METHOD editor2->set_text_as_r3table
        EXPORTING
          table = text_tab2.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'DOWNLOAD'.
          PERFORM header1.
          PERFORM header.
          PERFORM download ."changing COM_FILE LIKE LONG_FILE.
       WHEN 'SAVE'.
         PERFORM header1.
         PERFORM header.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  read_text1
          text
    -->  p1        text
    <--  p2        text
    FORM read_text1 USING   p_l_tid.
      CLEAR : lt_tline1.
      REFRESH text_tab1.
      l_tid = p_l_tid.
      name = vbeln.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
      CLIENT                        = SY-MANDT
          id                            = p_l_tid
          language                      = 'E'
          name                          = name
          object                        = 'VBBK'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
        TABLES
          lines                         =  lt_tline1
    EXCEPTIONS
       id                            = 1
       language                      = 2
       name                          = 3
       not_found                     = 4
       object                        = 5
       reference_check               = 6
       wrong_access_to_archive       = 7
       OTHERS                        = 8
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT.
      ENDIF.
      LOOP AT lt_tline1 .
       move-corresponding lt_tline1 to TEXT_tab1.
        APPEND lt_tline1-tdline TO text_tab1 .
       move '/' to lt_tline3-tdformat.
      ENDLOOP.
      REFRESH text_tab2.
    ENDFORM.                    " read_text1
    *&      Form  read_text
          text
    -->  p1        text
    <--  p2        text
    FORM read_text .
      CASE lsel.
        WHEN 'General Remarks in Amendment'.
          PERFORM read_text1 USING 'Z070'.
        WHEN 'General Specifications'.
          PERFORM read_text1 USING 'Z001'.
        WHEN 'Instructions to Accounts'.
          PERFORM read_text1 USING 'Z002'.
        WHEN 'Instructions to Product Engg'.
          PERFORM read_text1 USING 'Z003'.
        WHEN 'Instructions to Electrical'.
          PERFORM read_text1 USING 'Z004'.
        WHEN 'Instructions to Service'.
          PERFORM read_text1 USING 'Z005'.
        WHEN 'Instructions to Despatch'.
          PERFORM read_text1 USING 'Z006'.
        WHEN 'Instructions to Works'.
          PERFORM read_text1 USING 'Z007'.
        WHEN 'Instructions to MMD'.
          PERFORM read_text1 USING 'Z008'.
        WHEN 'Instructions to OED'.
          PERFORM read_text1 USING 'Z009'.
        WHEN 'Instructions to Project Markt'.
          PERFORM read_text1 USING 'Z037'.
        WHEN 'Painting Details'.
          PERFORM read_text1 USING 'Z010'.
        WHEN 'Docs. Reqd. for Insp. Call'.
          PERFORM read_text1 USING 'Z011'.
        WHEN 'Docs. to be sent with Invoice'.
          PERFORM read_text1 USING 'Z012'.
        WHEN 'Spl action plan for SO Exec'.
          PERFORM read_text1 USING 'Z013'.
        WHEN 'Spl. Inst. for record keeping'.
          PERFORM read_text1 USING 'Z014'.
        WHEN 'Customer Comm. Address'.
          PERFORM read_text1 USING 'Z015'.
        WHEN 'Customer Supplied Products'.
          PERFORM read_text1 USING 'Z016'.
        WHEN 'Cust. prods/traceability reqts'.
          PERFORM read_text1 USING 'Z017'.
        WHEN 'Qualification Tests'.
          PERFORM read_text1 USING 'Z018'.
        WHEN 'Instrument Calib. data to Cust'.
          PERFORM read_text1 USING 'Z019'.
        WHEN 'Test Cert. reqd. for submisn '.
          PERFORM read_text1 USING 'Z020'.
        WHEN 'Customer Inspection Stages '.
          PERFORM read_text1 USING 'Z021'.
        WHEN 'Un resolved points '.
          PERFORM read_text1 USING 'Z022'.
        WHEN 'Regret Reason '.
          PERFORM read_text1 USING 'Z023'.
        WHEN 'Terms of payment '.
          PERFORM read_text1 USING 'Z120'.
        WHEN 'Previous Sales Order '.
          PERFORM read_text1 USING 'Z040'.
        WHEN 'Escalation'.
          PERFORM read_text1 USING 'Z041'.
        WHEN 'Mode of Despatch Details '.
          PERFORM read_text1 USING 'Z042'.
        WHEN 'Packing Details '.
          PERFORM read_text1 USING 'Z043'.
        WHEN 'QAP Details '.
          PERFORM read_text1 USING 'Z044'.
        WHEN 'Approved Transporters  '.
          PERFORM read_text1 USING 'Z045'.
        WHEN 'Eye Catch  '.
          PERFORM read_text1 USING 'Z046'.
        WHEN 'LOI Details  '.
          PERFORM read_text1 USING 'Z047'.
        WHEN 'Delivery Details  '.
          PERFORM read_text1 USING 'Z048'.
        WHEN 'Order Description  '.
          PERFORM read_text1 USING 'Z049'.
        WHEN 'Penalty / LD Clause '.
          PERFORM read_text1 USING 'Z050'.
        WHEN 'Activity Completion Schedule  '.
          PERFORM read_text1 USING 'Z051'.
        WHEN 'Inspection Details '.
          PERFORM read_text1 USING 'Z052'.
        WHEN 'Checked By '.
          PERFORM read_text1 USING 'Z053'.
        WHEN 'Authorised By  '.
          PERFORM read_text1 USING 'Z054'.
        WHEN 'Distribution '.
          PERFORM read_text1 USING 'Z055'.
        WHEN 'Send Original&Dupl. Inv. to  '.
          PERFORM read_text1 USING 'Z056'.
        WHEN 'Send Copies of Inv.&Challan to '.
          PERFORM read_text1 USING 'Z057'.
        WHEN 'Send R/R & L/R to  '.
          PERFORM read_text1 USING 'Z058'.
        WHEN 'Bankers Name & Address  '.
          PERFORM read_text1 USING 'Z059'.
        WHEN 'Sales Tax Details  '.
          PERFORM read_text1 USING 'Z060'.
        WHEN 'Excise Duty Details  '.
          PERFORM read_text1 USING 'Z061'.
        WHEN 'CST Number & Date  '.
          PERFORM read_text1 USING 'Z062'.
        WHEN 'SST Number & Date  '.
          PERFORM read_text1 USING 'Z063'.
        WHEN 'Bank Charges Details '.
          PERFORM read_text1 USING 'Z064'.
        WHEN 'Price Basis Details '.
          PERFORM read_text1 USING 'Z065'.
        WHEN 'Freight Details  '.
          PERFORM read_text1 USING 'Z066'.
        WHEN 'Customer Collection Details  '.
          PERFORM read_text1 USING 'Z067'.
        WHEN 'Road Permit Details  '.
          PERFORM read_text1 USING 'Z068'.
        WHEN 'Insurance Details '.
          PERFORM read_text1 USING 'Z069'.
      ENDCASE.
    ENDFORM.                    " read_text
    *&      Form  itab_text
          text
    -->  p1        text
    <--  p2        text
    FORM itab_text .
    LOOP AT itab WHERE posnr = posnr.
       IF itab-posnr = lsel.
       CASE lsel.
         WHEN lsel.
      READ TABLE itab WITH KEY posnr = l_posnr.
      lsel1 = l_posnr.
      l_posnr1 = l_posnr.
      SHIFT lsel1 LEFT DELETING LEADING space.
      CONCATENATE itab-vbeln lsel1 INTO lsel1.
      CASE val.
        WHEN 'Material sales text'.
          PERFORM read_text2 USING '0001'.
        WHEN 'Technical Specifications'.
          PERFORM read_text2 USING 'Z001'.
        WHEN 'Packing Note'.
          PERFORM read_text2 USING 'Z005'.
      ENDCASE.
       ENDIF.
    ENDLOOP.
    ENDFORM.                    " itab_text
    *&      Form  read_text2
          text
         -->P_LSEL  text
    FORM read_text2 USING  p_lsel.
      CLEAR : lt_tline1.
      REFRESH text_tab1.
      CLEAR name.
      CLEAR obj.
    DATA : name LIKE stxh-tdname.
      name = lsel1.
      obj = p_lsel.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
      CLIENT                        = SY-MANDT
          id                            = p_lsel
          language                      = 'E'
          name                          = name
          object                        = 'VBBP'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
        TABLES
          lines                         =  lt_tline1
    EXCEPTIONS
       id                            = 1
       language                      = 2
       name                          = 3
       not_found                     = 4
       object                        = 5
       reference_check               = 6
       wrong_access_to_archive       = 7
       OTHERS                        = 8
      IF sy-subrc <> 0.
        CLEAR lsel1.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT.
      ENDIF.
      LOOP AT lt_tline1 .
       move-corresponding lt_tline1 to TEXT_tab1.
        APPEND lt_tline1-tdline TO text_tab1 .
       move '/' to lt_tline3-tdformat.
      ENDLOOP.
    ENDFORM.                    " read_text2
    *&      Form  save_text
          text
    -->  p1        text
    <--  p2        text
    FORM save_text1 ."USING p_l_tid.
      CALL METHOD editor2->get_text_as_r3table
        IMPORTING
          table = text_tab2.
      CLEAR lt_tline2.
      REFRESH lt_tline2.
      MOVE '*' TO lt_tline2-tdformat.
      LOOP AT text_tab2 INTO texttab2.
        MOVE texttab2 TO lt_tline2-tdline.
        APPEND lt_tline2.
        MOVE '/' TO lt_tline2-tdformat.
      ENDLOOP.
    HEADER-TDOBJECT = 'VBBK'.
    HEADER-TDNAME = p_l_tid.
    HEADER-TDID = 'ZTC1'.
    HEADER-TDSPRAS = 'EN'.
      CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
      CLIENT                = SY-MANDT
          header                = header
      INSERT                = ' '
       savemode_direct       = 'X'
      OWNER_SPECIFIED       = ' '
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
       newheader             = ls_thead
    TABLES
          lines                 = lt_tline2.
    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.
    ELSEIF sy-subrc  = 0.
       MESSAGE i398(00) WITH 'Text Saved'.
      ENDIF.
    ENDFORM.                    " save_text1
    *&      Form  header
          text
    -->  p1        text
    <--  p2        text
    FORM header .
      PERFORM save_text1 .
    ENDFORM.                    " header
    *&      Form  header1
          text
    -->  p1        text
    <--  p2        text
    FORM header1 .
      IF lsel1 IS NOT INITIAL.
        CLEAR header.
        REFRESH header.
        header-tdobject = 'VBBP'.
        header-tdname   = name.
        header-tdid     = obj.
        header-tdspras  = 'EN'.
        APPEND header.
      ELSEIF lsel1 IS INITIAL.
        CLEAR header.
        REFRESH header.
        header-tdobject = 'VBBK'.
        header-tdname = vbeln.
        header-tdid = l_tid.
        header-tdspras = 'EN'.
        APPEND header.
      ENDIF.
    ENDFORM.                                                    " header1
    *&      Form  download
          text
    -->  p1        text
    <--  p2        text
    FORM download ."CHANGING .
    DATA : dcp_file   LIKE long_file.
      DATA fullpath TYPE string.
      l_vbeln = vbeln.
      SHIFT l_vbeln LEFT DELETING LEADING '0'.
    concatenate 'C:\' l_vbeln '.txt' into   gcontrol-directory.
      CONCATENATE 'C:\' l_vbeln '.doc' INTO   fullpath.
    gcontrol-directory
      = 'C:\Text.txt'.
      = 'C:\Documents and Settings\Subhasis Mukherjee\Desktop\Text.txt'.
      CLEAR pc_tab.
      REFRESH pc_tab.
      IF l_posnr1 IS NOT INITIAL.
        CONCATENATE l_posnr1 '-' val_c INTO val_c SEPARATED BY space.
      ENDIF.
      pc_tab = val_c.
      APPEND pc_tab.
      pc_tab = 'Previous Text'.
      APPEND pc_tab.
         DO 2 TIMES.
      pc_tab = ''.
      APPEND pc_tab.
         ENDDO.
      LOOP AT text_tab1 INTO texttab1.
       IF sy-tabix = 1.
         IF l_posnr IS NOT INITIAL.
           CONCATENATE l_posnr '-' val INTO val SEPARATED BY space.
         ENDIF.
         pc_tab = val.
         APPEND pc_tab.
         pc_tab = 'Previous Text'.
         APPEND pc_tab.
         DO 2 TIMES.
         pc_tab = ''.
         APPEND pc_tab.
         ENDDO.
       ENDIF.
        pc_tab = texttab1-line.
        APPEND pc_tab.
       AT LAST.
         pc_tab = '***************************'.
         APPEND pc_tab.
       ENDAT.
      ENDLOOP.
      LOOP AT text_tab2 INTO texttab2.
        CLEAR pc_tab.
        IF sy-tabix = 1.
          DO 3 TIMES.
            pc_tab = ''.
            APPEND pc_tab.
          ENDDO.
          pc_tab = 'Changed Text'.
          APPEND pc_tab.
           DO 2 TIMES.
          pc_tab = ''.
          APPEND pc_tab.
           ENDDO.
        ENDIF.
        pc_tab = texttab2-line.
        APPEND pc_tab.
        AT LAST.
          pc_tab = '- - - - - - - - - - - - - - - - - - - - - - - - - - - '.
          APPEND pc_tab.
        ENDAT.
      ENDLOOP.
         CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
         EXPORTING
           window_title      = 'Path'
           default_extension = 'C:\'
           default_file_name = 'TEST.XLS'
         IMPORTING
           fullpath          = fullpath.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = fullpath
          filetype                = 'ASC'
          append                  = 'X'
        TABLES
          data_tab                = pc_tab
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        MESSAGE s001(00) WITH 'File downloaded successfully'.
      ENDIF.
    ENDFORM.                    " download
    Reward points pls if it is helpfull
    Regards
    Srimanta

  • Problem with header download using GUI_DOWNLOAD

    Hi folks,
    Iam facing a particular problem while downloading an internal table to excel file using GUI_DOWNLOAD and file type as 'DBF'.
    Once i download the file, iam getting an automatic header with contents as "F1, F2, F3,...." for all the columns. But, i want to put my own header there. Is there any way out ?
    Thanks and Regards,
    Vijay.

    hi,
    may be this code will be helpful to u
    Just take one field in header(internal table) of type c. and push all the field headings into it.
    and give that internal table to fieldnames it will resolve the problem.
    DATA:BEGIN OF HEADER OCCURS 0,
          F1(30) TYPE C ,
         END OF HEADER.
    DATA:BEGIN OF ITEM OCCURS 0,
           IT1(30) TYPE C,
           IT2(3) TYPE C,
           IT3(4) TYPE C,
         END OF ITEM.
       HEADER-F1 = 'NAME'.
       APPEND HEADER.
       CLEAR HEADER.
       HEADER-F1 = 'AGE'.
       APPEND HEADER.
       CLEAR HEADER.
       HEADER-F1  = 'STAT'.
       APPEND HEADER.
       CLEAR HEADER.
    ITEM-IT1 = 'MANOHAR'.
    ITEM-IT2 = '124'.
    ITEM-IT3 = 'T'.
    APPEND ITEM.
    CLEAR ITEM.
    ITEM-IT1 = 'SAI'.
    ITEM-IT2 = '24'.
    ITEM-IT3 = 'T'.
    APPEND ITEM.
    CLEAR ITEM.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = 'C:\FILE13.XLS'
       FILETYPE                        = 'DBF'
      tables
        data_tab                        = ITEM
        FIELDNAMES                      = HEADER.
    regards,
    manohar.

  • Unable to capture button event in pageLayout Controller

    Hi Guys,
    I have the following layout
    pageLayout
    pageLayoutCO (controller)
    ----header (Region)
    ----------messageComponentLayout (Region)
    -----------------MessageLovInpurt
    -----------------MessageChoice(Item)
    -----------------MessageTextInput
    -----------------MessageLayout
    ----------HideShow (Region)
    -----------------MessageLovInpurt(Item)
    -----------------MessageChoice(Item)
    -----------------MessageTextInput(Item)
    -----------MessageComponentLayout (Region)
    -----------------MessageLayout
    ------------------------SubmitButton(ID:SearchBtn)
    ------------------------SubmitButton(ID:ClearBtn, fires partial action named clear)
    -----------header(Region)
    I am not able to capture the event fired by the button ClearBtn in the controller of the pagelayout.....
    The two methods I used as follows aren't worked:
    if ("clear".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    if (pageContext.getParameter("ClearBtn") != null) {
    what should i do in order to capture the button event in the pageLayout Controller
    Thanks in advance
    Mandy
    Edited by: user8898100 on 2011-8-2 上午7:49

    Mandy,
    Its really strange that its not able to caputure the event in CO.
    Below is the way in which we handle to Submit action at CO level.
    /Check whether ClearBtn is same in case too.
    if(pageContext.getParameter("ClearBtn")!=null){
    System.out.println("Inside the Clear Btn Action");
    Regards,
    Gyan

  • How does sy-tabix affect by binary search transforming no fields?

    1 report ztx1110.
         2 data: begin of it occurs 3,
         3           f1(2) type n,
         4           f2    type i,
         5           f3(2) type c,
         6           f4    type p,
         7           end of it.
         8
         9   it-f1 = '40'. it-f3 = 'DD'. it-f2 = it-f4 = 4. append it.
        10  it-f1 = '20'. it-f3 = 'BB'. it-f2 = it-f4 = 2. append it.
        11
        12 sort it by f1.
        13 do 5 times.
        14     it-f1 = sy-index * 10.
        15     it-f3 = 'XX'.
        16     it-f2 = it-f4 = sy-index.
        17     read table it
        18         with key f1 = it-f1
        19         binary search
        20         transporting no fields.
        21     if sy-subrc <> 0.
        22         insert it index sy-tabix.
        23         endif.
        24     enddo.
        25
        26 loop at it.
        27     write: / it-f1, it-f2, it-f3, it-f4.
        28     endloop.
    in this program changing value of sy-tabix as such sy-index.
    means in it's first loop it's value is 1, on second loop it's 2, and so on up to 5.
    okay that is due to binary search.
    but why binary search affecting this system variable?

    Hi Vinay,
    It is simple.
    This depends on your select query. 
    CASE 1: If you use select ..into table.....,  then there wil be nothing in your header ls_vbap. Now if you execute READ stmt..you will get nothing.
    CASE 2: If you use Select..... into ls_vbap.....append ls_vbap....clear ls_vbap.....endselect.   In this case also the output of READ will be nothing because you are clearing header.  So while READ stmt you are comparing ls_vbap-vbeln and ls_vbap-posnr , as nothing in it you will get nothing
    CASE 3: If you use case 2 without CLEAR stmt then always you will get the index of the last fetched record...i.e., the last record of the internal table before sorting..
    I think it is helpful for you....if you are not clear just reply me

  • Nested structure when using FM XXL_SIMPLE_API

    I use this logic to fill in the headings before calling the FM xxl_simple_api in one of my programs. Is it possible to have nested structure(for <b>i_tab</b> in my code) and still use same kind of logic to fill in the headings? Not sure if this Fm would display data correctly when there is a component of strucutre type. I tried it, the field was blank with no contents in excel.
      DATA : nlines TYPE i,
             tempfile LIKE gxxlt_f-file,
             descr_ref TYPE REF TO cl_abap_structdescr,
             header LIKE gxxlt_v OCCURS 0 WITH HEADER LINE,
             it_print LIKE gxxlt_p OCCURS 0 WITH HEADER LINE.
    *data:               keycol type i.
      FIELD-SYMBOLS:
      <comp_wa> TYPE abap_compdescr,
      tempfile = file_name.
      REFRESH header.
      CLEAR header.
      descr_ref ?= cl_abap_typedescr=>describe_by_data( i_tab ).
      DESCRIBE TABLE descr_ref->components LINES nlines.
      nlines = nlines + 1.
      LOOP AT descr_ref->components ASSIGNING <comp_wa>.
        IF sy-tabix = nlines.
          EXIT.
        ELSE.
          header-col_no = sy-tabix.
          header-col_name = <comp_wa>-name.
          APPEND header.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'XXL_SIMPLE_API'
      EXPORTING
        filename = tempfile
    N_KEY_COLS = keycol
      TABLES
       col_text = header[]
    I appreciate your help. Thanks

    Hi,
    It's better to use another FM 'SAP_CONVERT_TO_XLS_FORMAT'
      call function 'SAP_CONVERT_TO_XLS_FORMAT'
                 exporting
                  I_FIELD_SEPERATOR = seper
                  I_LINE_HEADER = 'X'
                     I_FILENAME = P_FILE
                  tables
                      I_TAB_SAP_DATA = itab
                  exceptions
                      CONVERSION_FAILED = 1.
    Svetlin

  • Binary Search need clarification

    Hi All,
      I am facing a problem here in binary search. I will try to explain the situation with an example.
    Internal table : it_vbap
    Fields :  vbeln   posnr   qty
    Index 1  100      10       5
    index 2  100      10       5
    index 3  100      20       5
    index 4  100      20       5
    index 5  100      30       5
    index 6  100      30      5
    the abap code is this.
    sort it_vbap by vbeln posnr.
    read table it_vbap into ls_vbap with ket
                   vbeln  = ls_vbap-vbeln
                   psonr = ls_vbap-posnr
                   binary search.
    If sy-subrc  = 0.
    write : 'index :' sy-tabix.
    endif.
    My question here is does it always write index 1,3,5 (means in the all the case it should return the first record  ), otherwise it can also return 1, 3, 6.
    Pay attendtion the posnr are the same for every two records.
    The internal table not only contains 6 six records , my question was however not depends on the number of records in the internal table, the binary search will return the first sorted key record in the table or not.
    Please post your views.
    Thanks & regards,
    Vijay

    Hi Vinay,
    It is simple.
    This depends on your select query. 
    CASE 1: If you use select ..into table.....,  then there wil be nothing in your header ls_vbap. Now if you execute READ stmt..you will get nothing.
    CASE 2: If you use Select..... into ls_vbap.....append ls_vbap....clear ls_vbap.....endselect.   In this case also the output of READ will be nothing because you are clearing header.  So while READ stmt you are comparing ls_vbap-vbeln and ls_vbap-posnr , as nothing in it you will get nothing
    CASE 3: If you use case 2 without CLEAR stmt then always you will get the index of the last fetched record...i.e., the last record of the internal table before sorting..
    I think it is helpful for you....if you are not clear just reply me

Maybe you are looking for