Hi SDN Friends(BW)

Hi Friends,
Any one plz send me to step by step procedure of BW material,
It will be very helpfull for me
Regards
Justin

hi justin
i couldnt understand your question , can you please explain bit more.
Regards,
monika

Similar Messages

  • Dear sdn friends .how to add my company in sdn  contributors corner.

    dear sdn friends .how to add my company in sdn  contributors corner.

    HI,
    while giving ur mail id if u give ur company id
    eg:[email protected]
    softsol company will be added to the list and ur points will be included in that domain.
    so edit ur mail id in ur profile.then u can see ur company name after 24 hrs.
    rgds,
    bharat.

  • Help needed for ALV report

    Hi,
    i need to add coloums for the existing report which picks from G/L account.
    in this report I need to add some more columns from COSP-KSTAR, which shows the cost element details from G/L account.
    I need to restrict that cost element number according to the company code.
    Plz see this and let me know the things.
    1. I need to add FISCAL YEAR(COEP-GJAHR) in selection screen.
    2. I need to add column: Employee Cost (CSKS-KOSTL)
    3. add a column Staff Welfare (COSP-KSTAR) this is to restrict for the cost element 3000200 from G/L account
    4. add a column Recruitment restrict for the cost element(COSP-KSTAR) 3100040 from G/L account
    5. add a column Travels (suppressing some cost elements(COSP-KSTAR) and putting into Travels)
    6. add a column Subcontracts restrict for the cost element (COSP-KSTAR)3100360 from G/L account
    7. add a column Communication suppressing some cost elements and putting into Communication)
    8. add a column Rent restrict for the cost element (COSP-KSTAR)3100055 from G/L account
    9. add a column Back end Cost restrict for the cost element (COSP-KSTAR)3100065 from G/L account
    i can hardcode these cost elements.
    i did according to some of our sdn friends guidence but it is going to dump.
    hear i am sending the code what i changed.
    it is giving the error with the select.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    plz try to help me out in this issue.
    hear i am sending the complete code what i worte.
    *& Report  ZPROJECT_PROFIT2
    REPORT  ZPROJECT_PROFIT2.
    *********************MAIN DOCUMENTATION BLOCK*************************
    Project Code           :
    Program Name           :Zproject_profit1.
    Purpose of program     :This report will give the gross margin for a project as
    *a whole based on some selected input criteria.
    Author of program      :JAYA KRISHNA .B.
    INPUT/OUTPUT FILE      :nil
    TYPE-POOLS : SLIS."For ALV display.
    TABLES : COEP,  "CO Object: Line Items  (by period).
             AUFK,   "Order master data.
             csks,    "Cost center master data
             cosp.    "CO Objects
    *&  Include           ZSTRUCTURE
    types:    BEGIN OF TY_COEP ,            "structure of table COEP.
              BUKRS LIKE COEP-BUKRS,
              KOKRS LIKE COEP-KOKRS,
              OBJNR LIKE COEP-OBJNR,
               gjahr like coep-gjahr,
              kstar like coep-kstar,
              OBJNR_N1 LIKE COEP-OBJNR_N1,
              PERIO LIKE COEP-PERIO,
              BEKNZ LIKE COEP-BEKNZ,
              WKGBTR LIKE COEP-WKGBTR,
              WOGBTR LIKE COEP-WOGBTR,
              BELNR LIKE COEP-BELNR,
              END OF TY_COEP,
             BEGIN OF TY_AUFK ,             "structure of table AUFK.
             BUKRS LIKE AUFK-BUKRS,
             KOKRS LIKE AUFK-KOKRS,
             OBJNR LIKE AUFK-OBJNR,
             KTEXT LIKE AUFK-KTEXT,
             ANFAUFNR LIKE AUFK-ANFAUFNR,
             AUFEX LIKE AUFK-AUFEX,
             USER2 LIKE AUFK-USER2,
             USER0 LIKE AUFK-USER0,
             USER1 LIKE AUFK-USER1,
             USER3 LIKE AUFK-USER3,
             USER6 LIKE AUFK-USER6,
             USER7 LIKE AUFK-USER7,
             USER8 LIKE AUFK-USER8,
             ABKRS(10) TYPE C,
             USER9 LIKE AUFK-USER9,
             AUFNR LIKE AUFK-AUFNR,
           END OF TY_AUFK,
           begin of ty_csks,
           kokrs like csks-kokrs,
            kostl like csks-kostl,
            bukrs like csks-bukrs,
            objnr like csks-objnr,
                 end of ty_csks.
    DATA :   BEGIN OF IT_COSP occurs 100,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           END OF IT_COSP.
    DATA : IT_COEP TYPE TABLE OF TY_COEP,     " Declaraton of tables COEP and AUFK.
           IT_AUFK TYPE TABLE OF TY_AUFK,
           IT_CSKS TYPE TABLE OF TY_CSKS.
          IT_COSP TYPE TABLE OF TY_COSP.
    DATA : WA_COEP LIKE LINE OF IT_COEP,      " Declaration of work areas for tables COEP and AUFK.
           WA_AUFK LIKE LINE OF IT_AUFK,
           WA_CSKS LIKE LINE OF IT_CSKS.
          WA_COSP LIKE LINE OF IT_COSP.
    DATA : BEGIN OF IT_DISPLAY OCCURS 0,      " Declaration of display table.
            OBJNR_N1 LIKE COEP-OBJNR_N1,
            OBJNR_N12 LIKE COEP-OBJNR_N1,
            KTEXT1 LIKE AUFK-KTEXT,
            WKGBTR LIKE COEP-WKGBTR,
            WOGBTR LIKE COEP-WOGBTR,
            WKGBTR1  LIKE COEP-WTGBTR,
            WOGBTR1 LIKE COEP-WOGBTR,
            ADDK LIKE COEP-WOGBTR,
            ADDO LIKE COEP-WOGBTR,
            ADDK1 LIKE COEP-WOGBTR,
            ADDO1 LIKE COEP-WOGBTR,
            PROFIT1 LIKE COEP-WOGBTR,
            PROFIT2 LIKE COEP-WOGBTR,
            BEKNZ LIKE COEP-BEKNZ,
            BUKRS LIKE AUFK-BUKRS,
            anfaufnr LIKE AUFK-anfaufnr,
            aufex like aufk-aufex,
            OBJNR LIKE AUFK-OBJNR,
            USER2 LIKE AUFK-USER2,
            USER0 LIKE AUFK-USER0,
            USER1 LIKE AUFK-USER1,
            USER3 LIKE AUFK-USER3,
            USER6 LIKE AUFK-USER6,
            USER7 LIKE AUFK-USER7,
            USER8 LIKE AUFK-USER8,
            ABKRS LIKE AUFK-ABKRS,
            USER9 LIKE AUFK-USER9,
            PERIO LIKE COEP-PERIO,
            AUFNR LIKE AUFK-AUFNR,
            STR(5) TYPE C,
            WORK(10) TYPE C,
           END OF IT_DISPLAY,
      : BEGIN OF IT_DISPLAY1 OCCURS 0,      " Declaration of second display table.
         OBJNR_N1 LIKE COEP-OBJNR_N1,
         OBJNR_N12 LIKE COEP-OBJNR_N1,
         KTEXT1 LIKE AUFK-KTEXT,
         WKGBTR LIKE COEP-WKGBTR,
         WOGBTR LIKE COEP-WOGBTR,
         WKGBTR1  LIKE COEP-WTGBTR,
         WOGBTR1 LIKE COEP-WOGBTR,
         ADDK LIKE COEP-WOGBTR,
         ADDO LIKE COEP-WOGBTR,
         ADDK1 LIKE COEP-WOGBTR,
         ADDO1 LIKE COEP-WOGBTR,
         PROFIT1 LIKE COEP-WOGBTR,
         PROFIT2 LIKE COEP-WOGBTR,
         BEKNZ LIKE COEP-BEKNZ,
         BUKRS LIKE AUFK-BUKRS,
         anfaufnr like aufk-anfaufnr,
         aufex like aufk-aufex,
         OBJNR LIKE AUFK-OBJNR,
         USER2 LIKE AUFK-USER2,
         USER0 LIKE AUFK-USER0,
         USER1 LIKE AUFK-USER1,
         USER3 LIKE AUFK-USER3,
         USER6 LIKE AUFK-USER6,
         USER7 LIKE AUFK-USER7,
         USER8 LIKE AUFK-USER8,
         ABKRS LIKE AUFK-ABKRS,
         USER9 LIKE AUFK-USER9,
         PERIO LIKE COEP-PERIO,
         AUFNR LIKE AUFK-AUFNR,
         STR(5) TYPE C,
         WORK(10) TYPE C,
        END OF IT_DISPLAY1.
    data : it_field type slis_fieldcat_alv,        " Declaration of ALV variables
           it_field_t type slis_t_fieldcat_alv,
            xlayout    TYPE slis_layout_alv.
    data : it_event type slis_t_event,
          wa_event like line of it_event.
    DATA : WA_TOP TYPE SLIS_LISTHEADER,
           IT_TOP TYPE SLIS_T_LISTHEADER.
    data:w_lines type i,
          w_occurs type i,
          STR(5) TYPE C,
          WORK(10) TYPE C.
          constants : c_selection type char20 value 'Selection based on'. " Declaration of a constant.
    selection-screen BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS S_BUKRS FOR AUFK-BUKRS OBLIGATORY.
    SELECT-OPTIONS S_OBJNR FOR AUFK-AUFNR.
    SELECT-OPTIONS S_ANF FOR AUFK-ANFAUFNR.
    SELECT-OPTIONS S_AUFEX FOR AUFK-AUFEX.
    SELECT-OPTIONS S_USER2 FOR AUFK-USER2.
    SELECT-OPTIONS S_USER0 FOR AUFK-USER0.
    SELECT-OPTIONS S_USER1 FOR AUFK-USER1.
    SELECT-OPTIONS S_USER3 FOR AUFK-USER3.
    SELECT-OPTIONS S_USER6 FOR AUFK-USER6.
    SELECT-OPTIONS S_ABKRS FOR AUFK-ABKRS.
    SELECT-options s_gjahr for coep-gjahr obligatory.
    SELECT-OPTIONS S_PERIO FOR COEP-PERIO OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLK .
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : ONSITE RADIOBUTTON GROUP RADI.
    PARAMETERS : OFFSHORE RADIOBUTTON GROUP RADI.
    PARAMETERS : BOTH RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN END OF BLOCK BLK1 .
    start-of-selection.
    *ZAUFK
                                  " Selection of records from aufk to internal table.
    IF ONSITE EQ 'X' .
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN s_anf AND
    aufex in s_aufex and
    aufnr IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 EQ 'X' .
    ENDIF.
    IF OFFSHORE EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufnR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 <> 'X'.
    ENDIF.
    IF BOTH EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufNR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS.
    ENDIF.
    *&  Include           ZCOEP
                                  " Selection of records from coep to internal table.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    *&  Include           ZPROFIT_CALC
                                 " Calculations for income and Profit of the employee.
    if not it_coep[] is initial.
        select objnr gjahr wrttp versn kstar from cosp into TABLE It_cosp for
    all entries in it_coep where objnr = IT_COEP-objnr .
    endif.
      LOOP AT IT_coep INTO WA_coep.
        read table IT_aufk into WA_aufk with key OBJNR = wa_coep-OBJNR.
    case it_cosp-kstar.
    when '3000200'.
    it_cosp-kstar = cosp-kstar.
    when '3100040'.
    it_cosp-kstar = cosp-kstar.
    when '3100360'.
    it_cosp-kstar = cosp-kstar.
    when '3100055'.
    it_cosp-kstar = cosp-kstar.
    when '3100065'.
    it_cosp-kstar = cosp-kstar.
    when '3100115'.
    it_cosp-kstar = cosp-kstar.
    when '3100120'.
    it_cosp-kstar = cosp-kstar.
    when '3100130'.
    it_cosp-kstar = cosp-kstar.
    when '3100135'.
    it_cosp-kstar = cosp-kstar.
    when '3100140'.
    it_cosp-kstar = cosp-kstar.
    when '3100145'.
    it_cosp-kstar = cosp-kstar.
    when '3100150'.
    it_cosp-kstar = cosp-kstar.
    when '3100155'.
    it_cosp-kstar = cosp-kstar.
    when '3100160'.
    it_cosp-kstar = cosp-kstar.
    when '3100165'.
    it_cosp-kstar = cosp-kstar.
    when '3100170'.
    it_cosp-kstar = cosp-kstar.
    endcase.
        IT_DISPLAY-BUKRS = WA_AUFK-BUKRS.
        IT_DISPLAY-anfaufnr = WA_AUFK-anfaufnr.
        it_display-aufex  = wa_aufk-aufex.
        IT_DISPLAY-OBJNR = WA_AUFK-OBJNR.
        IT_DISPLAY-USER2 = WA_AUFK-USER2.
        IT_DISPLAY-USER0 = WA_AUFK-USER0.
        IT_DISPLAY-USER1 = WA_AUFK-USER1.
        IT_DISPLAY-USER3 = WA_AUFK-USER3.
        IT_DISPLAY-USER6 = WA_AUFK-USER6.
        IT_DISPLAY-USER7 = WA_AUFK-USER7.
        IT_DISPLAY-USER8 = WA_AUFK-USER8.
        IT_DISPLAY-ABKRS = WA_AUFK-ABKRS.
        IT_DISPLAY-USER9 = WA_AUFK-USER9.
        IT_DISPLAY-KTEXT1 =  WA_AUFK-KTEXT.
        if WA_AUFK-abkrs = 01.
          IT_DISPLAY-STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          IT_DISPLAY-STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          IT_DISPLAY-WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          IT_DISPLAY-WORK = 'OFFSHORE'.
        ENDIF.
        it_display-ABKRS = it_display-user7.
        IF wa_coep-BEKNZ = 'S'.
          IT_DISPLAY-WKGBTR = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR.
          IT_DISPLAY-ADDO = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR.
          IT_DISPLAY-ADDK1 = 0.
          IT_DISPLAY-ADDO1 = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        IF WA_COEP-BEKNZ = 'H'.
          IT_DISPLAY-WKGBTR1 = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR1 = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK1 = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR1.
          IT_DISPLAY-ADDO1 = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR1.
          IT_DISPLAY-ADDK = 0.
          IT_DISPLAY-ADDO = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        collect it_display into it_display1.
        clear it_display.
      ENDLOOP.
                        "calc
    *&  Include           ZPROFIT_DISPLAY
      LOOP AT IT_DISPLAY1.                                         "it_display.
        read table IT_COEP into WA_COEP with key OBJNR =
        IT_DISPLAY-OBJNR.
        read table IT_AUFK into WA_AUFK with key aufnr = IT_DISPLAY-aufnr.
        if WA_AUFK-abkrs = 01.
          STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          WORK = 'OFFSHORE'.
        ENDIF.
      endloop.
      clear it_field.
      it_field-col_pos = 1.
      it_field-fieldname = 'AUFNR'.
      it_field-seltext_l = 'project id.'.
      it_field-outputlen = 15.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 2.
      it_field-fieldname = 'KTEXT1'.
      it_field-seltext_l = 'Project Name'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 3.
      it_field-fieldname = 'USER7'.
      it_field-seltext_l = 'Start Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 4.
      it_field-fieldname = 'USER8'.
      it_field-seltext_l = 'End Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 5.
      it_field-fieldname = 'USER2'.
      it_field-seltext_l = 'Location'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 6.
      it_field-fieldname = 'USER0'.
      it_field-seltext_l = 'Vertical'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 7.
      it_field-fieldname = 'USER1'.
      it_field-seltext_l = 'Sub_vertical'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 8.
      it_field-fieldname = 'USER3'.
      it_field-seltext_l = 'Technology'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 9.
      it_field-fieldname = 'USER6'.
      it_field-seltext_l = 'Department'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 10.
      it_field-fieldname = 'WORK'.
      it_field-seltext_l = 'Onsite/Offshore'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 11.
      it_field-fieldname = 'STR'.
      it_field-seltext_l = 'T&M/FP'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 12.
      it_field-fieldname = 'KOSTL'.
      it_field-seltext_l = 'EMP COST'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 13.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'STAFF WELFARE'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 14.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RECRUITMENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 15.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'TRAVELS'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 16.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'SUBCONTRACT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 17.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'COMMUNICATION'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 18.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 19.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'BACKEND COST (PROJECT EXP)'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 20.
      it_field-fieldname = 'ADDO'.
      it_field-seltext_l = 'Direct costs'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 21.
      it_field-fieldname = 'ADDO1'.
      it_field-seltext_l = 'Income'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 22.
      it_field-fieldname = 'PROFIT2'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 23.
      it_field-fieldname = 'ADDK'.
      it_field-seltext_l = 'Direct costs(Grp cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 24.
      it_field-fieldname = 'ADDK1'.
      it_field-seltext_l = 'Income(Grp Cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 25.
      it_field-fieldname = 'PROFIT1'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      xlayout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = 'ZPROJECT_PROFIT1'
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE_PROFIT'
      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                         = xlayout
         IT_FIELDCAT                       =  it_field_t
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
      IS_VARIANT                        =
      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                          = IT_DISPLAY1
    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.
      clear it_field_t.
      "it_display.
    FORM USER_COMMAND using r_ucomm like sy-ucomm rs type slis_selfield.
      include zinteractive_profit."Secondary list for calling KO03.
    ENDFORM.                    "USER_COMMAND.
    Thanks & Regards,
    Lakshmi..

    Hi,
    i did according to ur suggession.
    now it is going dump.
    and it is telling like this.
    2629               i_event_name      = 'SUBTOTAL_TEXT'
    2630               is_subtottxt_info = ls_subtot_info
    2631               ip_subtot_line    = lr_data
    2632             changing
    2633               c_subtottxt       = l_subtottxt.
    2634           ls_lvc_data-value = l_subtottxt.
    2635
    2636           append ls_lvc_data to ct_lvc_data.
    2637         endif.
    2638
    2639 ************************************
    2640 * Column per Fieldcat Entry
    2641 ************************************
    2642         clear ls_lvc_data-style.
    2643         loop at it_fcat_local assigning <ls_fcat>
    2644                 where tech ne 'X' and no_out ne 'X'.
    2645           if l_invisible eq 'X'.
    2646             clear l_invisible.
    2647             if <ls_fcat>-do_sum is initial.
    2648               continue.
    2649             else.
    2650               clear ls_lvc_data-col_pos.
    2651             endif.
    2652           endif.
    2653
    2654           add 1 to ls_lvc_data-col_pos.
    2655
    2656           assign component <ls_fcat>-fieldname
    2657                            of structure <ls_data> to <l_field_val
    2658           if sy-subrc ne 0.
    >>>>>             message x000(0k).
    2660           endif.
    2661
    2662 *... work on average
    2663           if <ls_fcat>-do_sum eq 'C'.
    2664             clear l_entries.
    2665
    2666             assign space to <l_unit>.
    2667             if not <ls_fcat>-cfieldname is initial.
    2668               assign component <ls_fcat>-cfieldname
    2669                      of structure <ls_data> to <l_unit>.
    2670             endif.
    2671             if not <ls_fcat>-qfieldname is initial.
    2672               assign component <ls_fcat>-qfieldname
    2673                      of structure <ls_data> to <l_unit>.
    2674             endif.
    2675
    2676             l_from = ls_grpl-index_from.
    2677             l_to   = ls_grpl-index_to.
    2678             if ls_grpl-index_from is initial and
    plz any of u help me to come out with solution.
    Thanks & Regards,
    Lakshmi..

  • SSO to SAP EP6 (for Employee Self Service) using WebSEAL

    Hi SDN friends,
    We are about to embark on a SSO implementation using IBM WebSEAL for SAP EP6 ESS (Employee Self Service) connecting through to an SAP R/3 4.7 server.  Since the ESS solution for 4.7 still uses ITS services, this means that we have ITS iViews in the EP6 portal.
    We have managed to look through the whitepaper 'IBM Tivoli Access Manager - Single Sign On for SAP NetWeaver - September 2005' described at https://www.sdn.sap.com/irj/sdn/developerareas/ibm
    We have the following queries, if anybody has a simple answer to these:
    -  Is it absolutely necessary to configure an SNC connection between ITS/EP6 and R/3 server to achieve SSO for the portal?
    -  Given that SAP EP6 references ITS IAC iviews, is it necessary for us to configure both ITS and EP6 for SSO, or can we simply configure EP6 for SSO?  If so, is it also necessary to configure both for SSL?
    -  Otherwise, how easy is it to set up SSO in this scenario without SSL (for demo purposes)?
    Any thoughts would be greatly appreciated.
    Cheers
    John Moy

    Hello John,
    regarding your questions:
    ad 1) no. SNC is only mandatory if you use X.509-based SSO to R/3. You can also use SAP logon ticket-based SSO from EP to R/3 or usermapping that do both not require SNC.
    ad 2) yes, you have to configure both EP and ITS at WebSeal.
    ad 3) you can always omit SSL. However for production use, it is recommended.
    Regards
    Michael

  • Report on sales order on hold

    hello sdn friends,
    how to develop an report to display to open sales orders on hold.
    i dont have any idea about this,please help regarding this.

    Hi,
    Check the program
    TABLES:vbak,
           vbap,
           tvko,
           tvak,
           mara,
           tvtw,
           kna1,
           vbpa.
    TYPE-POOLS : slis.
                               GLOBAL TYPES
                       naming convention: "TY_name"
    TYPES : BEGIN OF ty_vbak       ,
            vbeln  TYPE vbak-vbeln ,
            auart  TYPE vbak-auart , " DRFK904686
            vkorg  TYPE vbak-vkorg ,
            vtweg  TYPE vbak-vtweg ,
            vkgrp  TYPE vbak-vkgrp ,
            bstnk  TYPE vbak-bstnk ,  "DRFK904686(+)
            kunrsl TYPE vbak-kunnr ,
            END OF ty_vbak         .
    TYPES: BEGIN OF ty_vbap        ,
            vbeln TYPE vbap-vbeln  ,
            posnr TYPE vbap-posnr  ,
            matnr TYPE vbap-matnr  ,
            matkl TYPE vbap-matkl  ,
            kwmeng TYPE vbap-kwmeng,
            vrkme  TYPE vbap-vrkme ,   "order unit
            zmeng  TYPE vbap-zmeng ,
            zieme  TYPE vbap-zieme ,  "order unit
            netpr  TYPE vbap-netpr ,  "price
            netwr  TYPE vbap-netwr ,  "DRFK904686(+)
          END OF ty_vbap           .
    TYPES:BEGIN OF ty_vbuk     ,
          vbeln TYPE vbuk-vbeln,
    Start of addition DRFK904686
          lfstk TYPE statv     ,
          lfgsk TYPE statv     ,
          fkstk TYPE statv     ,
    End of addition DRFK904686
          END OF ty_vbuk       .
    TYPES:BEGIN OF ty_vbpa     ,
            vbeln TYPE vbpa-vbeln,
            kunrsh TYPE kunnr    ,
          END OF ty_vbpa       .
    TYPES:BEGIN OF ty_makt  ,
            matnr TYPE matnr,
            maktx TYPE maktx,
          END OF ty_makt.
    TYPES:BEGIN OF ty_t023t,
           matkl TYPE matkl,
           wgbez TYPE wgbez,
         END OF ty_t023t.
    TYPES:BEGIN OF ty_kna1    ,
           kunnr TYPE kunnr   ,
           name1 TYPE name1_gp,
         END OF ty_kna1.
    TYPES:BEGIN OF ty_final         ,
            vbeln  TYPE vbak-vbeln  ,
            auart  TYPE vbak-auart  ,
            vkorg  TYPE vbak-vkorg  ,
            vtweg  TYPE vbak-vtweg  ,
            vkgrp  TYPE vbak-vkgrp  ,
            bstnk  TYPE vbak-bstnk  , "PO Number; DRFK904686(+)
            kunrsl TYPE vbak-kunnr  ,
            name1  TYPE name1_gp    ,
            matnr  TYPE vbap-matnr  ,
            maktx  TYPE maktx       ,
            matkl  TYPE vbap-matkl  ,
            wgbez  TYPE wgbez       ,
            kwmeng TYPE vbap-kwmeng ,
            vrkme  TYPE vbap-vrkme  ,   "order unit
            zmenge TYPE vbap-kwmeng ,
            netpr  TYPE vbap-netpr  ,  " price "vv
            netwr  TYPE vbap-netwr  ,
            zmein  TYPE vbap-meins  ,
            kunrsh TYPE kunnr       ,
            name2  TYPE name1_gp    ,
    Start of addition DRFK904686
            lfstk  TYPE statv     ,
            lfgsk  TYPE statv     ,
            fkstk  TYPE statv     ,
    End of addition DRFK904686
          END OF ty_final         .
                              GLOBAL CONSTANTS
                       naming convention: "c_name"
    CONSTANTS: c_sh                         TYPE vbpa-parvw        VALUE 'WE'                   ,
               c_formname_top_of_page       TYPE slis_formname     VALUE 'F_DISPLAY_TOP_OF_PAGE',
               c_en(2)                      TYPE c                 VALUE 'EN'                   ,
               c_a                          TYPE char1             VALUE 'A'                    .
                        GLOBAL ELEMENTARY VARIABLES
                        naming convention: "w_name"
    DATA :w_list_top_of_page      TYPE slis_t_listheader,
          w_kwmeng                TYPE vbap-kwmeng      ,
          w_meins                 TYPE t006-msehi       ,
          w_zmein                 TYPE t006-msehi       ,
          w_repid                 TYPE sy-repid         ,
          w_zmenge                TYPE vbap-kwmeng      ,
          w_events                TYPE slis_t_event     ,
          w_datum                 TYPE sy-datum         ,
          w_umrez1                TYPE marm-umrez       ,
          w_umren1                TYPE marm-umren       ,
          w_umrez2                TYPE marm-umrez       ,
          w_umren2                TYPE marm-umren       ,
          w_text(25)              TYPE c                .
                              GLOBAL STRUCTURES
                        naming convention: "st_name"
    DATA:st_vbak  TYPE ty_vbak  ,
         st_vbap  TYPE ty_vbap  ,
         st_vbpa  TYPE ty_vbpa  ,
         st_makt  TYPE ty_makt  ,
         st_t023t TYPE ty_t023t ,
         st_knasl TYPE  ty_kna1 ,
         st_knash TYPE  ty_kna1 ,
         st_vbuk  TYPE  ty_vbuk ,
         st_final TYPE ty_final .
    DATA:st_fieldcat    TYPE slis_fieldcat_alv ,
         st_layout      TYPE slis_layout_alv   .
                           GLOBAL INTERNAL TABLES
                         naming convention: "i_name"
    DATA:i_vbak  TYPE TABLE OF ty_vbak  ,
         i_vbap  TYPE TABLE OF ty_vbap  ,
         i_vbuk  TYPE TABLE OF ty_vbuk  ,
         i_vbpa  TYPE TABLE OF ty_vbpa  ,
         i_makt  TYPE TABLE OF ty_makt   ,
         i_t023t TYPE TABLE OF ty_t023t ,
         i_knasl TYPE TABLE OF ty_kna1  ,
         i_knash TYPE TABLE OF ty_kna1  ,
         i_final TYPE TABLE OF ty_final .
    DATA:i_fieldcat    TYPE slis_t_fieldcat_alv ,
         i_variant     TYPE disvariant          .
    DEFINE m_fieldcat.
      add 1 to st_fieldcat-col_pos.
      st_fieldcat-fieldname   = &1.
      st_fieldcat-ref_tabname = &2.
      st_fieldcat-seltext_s   = &3.
      st_fieldcat-seltext_l   = &4.
      st_fieldcat-datatype    = &5.
      append st_fieldcat to i_fieldcat.
    END-OF-DEFINITION.
                          PARAMETERS & SELECT-OPTIONS
                     aming convention: "p_name" & "s_name"
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *SELECT-OPTIONS : s_vkorg    FOR  vbak-vkorg  OBLIGATORY,
                    s_vtweg    FOR  vbak-vtweg  OBLIGATORY,
                    s_kunrsl   FOR  vbak-kunnr            ,
                    s_kunrsh   FOR  vbpa-kunnr            ,
                    s_matnr    FOR  vbap-matnr            ,
                    s_auart    for  vbak-auart            . "DRFK904686
                 s_datum    FOR  sy-datum  OBLIGATORY DEFAULT sy-datum."DRFK904686
    SELECT-OPTIONS : s_vkorg    FOR  tvko-vkorg  OBLIGATORY,
                     s_vtweg    FOR  tvtw-vtweg  OBLIGATORY,
                     s_kunrsl   FOR  kna1-kunnr            ,
                     s_kunrsh   FOR  kna1-kunnr            ,
                     s_matnr    FOR  mara-matnr            ,
                     s_auart    FOR  tvak-auart            .    "DRFK904686
    PARAMETERS:   p_meins TYPE vbap-meins.
    SELECTION-SCREEN  END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-006 FOR FIELD p_var.
    PARAMETERS: p_var TYPE disvariant-variant.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b5.
                              INITIALIZATION
    INITIALIZATION.
    Report id assigned to Global variable
      w_repid = sy-repid.
    EVENTS TABLE BUILD
      PERFORM f_eventtab_build USING w_events[].
    Processing of listheader
      PERFORM f_comment_build  USING w_list_top_of_page[].
      CLEAR i_variant.
      i_variant-report = sy-repid.
    Read default display variant (description only, w/o field catalog)
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = c_a
        CHANGING
          cs_variant = i_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc EQ 0.
        p_var = i_variant-variant.
      ENDIF.
    Start of addition DRFK904686
                          AT SELECTION-SCREEN ON s_vkorg
    Sales Organisation
    AT SELECTION-SCREEN ON s_vkorg.
      PERFORM f_validate_vkorg.
                          AT SELECTION-SCREEN ON s_vtweg
    Distribution Channel
    AT SELECTION-SCREEN ON s_vtweg.
      PERFORM f_validate_vtweg.
                          AT SELECTION-SCREEN ON s_kunrsl
    Sold-to-party
    AT SELECTION-SCREEN ON s_kunrsl.
      IF NOT s_kunrsl[] IS INITIAL.
        PERFORM f_validate_cust.
      ENDIF.
                          AT SELECTION-SCREEN ON s_kunrsh
    Ship-to-party
    AT SELECTION-SCREEN ON s_kunrsh.
      IF NOT s_kunrsh[] IS INITIAL.
        PERFORM f_validate_shipto.
      ENDIF.
                          AT SELECTION-SCREEN ON s_matnr
    Material Number
    AT SELECTION-SCREEN ON s_matnr.
      IF NOT s_matnr[] IS INITIAL.
        PERFORM f_validate_matnr.
      ENDIF.
                          AT SELECTION-SCREEN ON s_auart
    Order Type
    AT SELECTION-SCREEN ON s_auart.
      IF NOT s_auart[] IS INITIAL.
        PERFORM f_validate_auart.
      ENDIF.
    End of addition DRFK904686
                   AT SELECTION-SCREEN ON VALUE-REQUEST
    F4 for Layout Variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.
      PERFORM f_get_alv_variant CHANGING p_var.
                          AT SELECTION-SCREEN ON
    Validate Layout Variant
    AT SELECTION-SCREEN ON p_var.
      IF NOT p_var IS INITIAL.
        PERFORM f_check_alv_variant USING p_var.
      ENDIF.
                               START-OF-SELECTION
    START-OF-SELECTION.
    begin of changes DRFK904686
      PERFORM f_fetch_vbuk.
      PERFORM f_fetch_vbak.
    *perform to fetch the data from vbuk.
    *perform to fetch the data from vbak.
    PERFORM f_fetch_vbak.
    *perform to fetch the data from vbuk.
    PERFORM f_fetch_vbuk.
    end of changes DRFK904686
    *perform to fetch the data from vbpa.
      PERFORM f_fetch_vbpa.
    *perform to fetch the data from vbap.
      PERFORM f_fetch_vbap.
    *perform to fetch the material description.
      PERFORM f_fetch_makt.
    *perform to fetch the material group description.
      PERFORM f_fetch_t023t.
    *perform to fetch the customer name
      PERFORM f_fetch_knasl.
    *perform to fetch the customer name
      PERFORM f_fetch_knash.
    *perofrm to move the data into final table
      PERFORM f_move_final.
    Finding no of entries in Internal Table
      IF LINES( i_final ) EQ 0.
        MESSAGE s000 WITH 'No documents found for the  selection criteria'(019).
        EXIT.
      ENDIF.
    *perform for fieldcatalog building
      PERFORM f_build_fieldcat.
    *perform to display the list
      PERFORM f_list_dispaly.
    *&      Form  f_validate_vkorg
          text
         -->P_S_VKORG  text
    FORM f_validate_vkorg.
      SELECT vkorg
         FROM tvko
         UP TO 1 ROWS
         INTO tvko-vkorg
       WHERE vkorg IN s_vkorg.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Sales Organization is invalid'(033).
      ENDIF.
    ENDFORM.                    " f_validate_vkorg
    *&      Form  f_validate_vtweg
          text : This form is used to validate the Distribution Channel
    FORM f_validate_vtweg.
      SELECT vtweg
            FROM tvtw
            UP TO 1 ROWS
            INTO tvtw-vtweg
          WHERE vtweg IN s_vtweg.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Distribution Channel is invalid'(032).
      ENDIF.
    ENDFORM.                    " f_validate_vtweg
    *&      Form  f_validate_cust
          text: This form is used to validate the Sold-to party .
    FORM f_validate_cust.
      SELECT kunnr
             FROM kna1
             UP TO 1 ROWS
             INTO kna1-kunnr
           WHERE kunnr IN s_kunrsl.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Customer is invalid'(034).
      ENDIF.
    ENDFORM.                    " f_validate_cust
    *&      Form  f_validate_shipto
           text: This form is used to validate the Ship-to party .
    FORM f_validate_shipto.
      SELECT kunnr
             FROM kna1
             UP TO 1 ROWS
             INTO kna1-kunnr
           WHERE kunnr IN s_kunrsh.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Ship-to party is invalid'(035).
      ENDIF.
    ENDFORM.                    " f_validate_shipto
    *&      Form  f_validate_matnr
          text: This form is used to validate material.
    FORM f_validate_matnr .
      SELECT matnr
        FROM mara
        UP TO 1 ROWS
        INTO mara-matnr
      WHERE matnr IN s_matnr.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Material is invalid'(036).
      ENDIF.
    ENDFORM.                    " f_validate_matnr
    *&      Form  f_validate_auart
          text: This form is used to validate Order Type
    FORM f_validate_auart .
      SELECT auart
          FROM tvak
          UP TO 1 ROWS
          INTO tvak-auart
        WHERE auart IN s_auart.
      ENDSELECT.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH 'Order Type is invalid'(037).
      ENDIF.
    ENDFORM.                    " f_validate_auart
    *&      Form  sub_get_alv_variant
          To display variant selection dialog box
    FORM f_get_alv_variant  CHANGING p_layvar TYPE disvariant-variant.
      CLEAR i_variant.
      DATA lw_exit(1) TYPE c.
      i_variant-report   = sy-repid.
      i_variant-username = sy-uname.
    Display variant selection dialog box
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = i_variant
          i_save        = c_a
        IMPORTING
          e_exit        = lw_exit
          es_variant    = i_variant
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc EQ 0.
        IF lw_exit IS INITIAL.
          p_layvar = i_variant-variant.
        ENDIF.
      ELSE.
        MESSAGE i000 WITH 'No display variants found'(007).
      ENDIF.
    ENDFORM.                    " sub_get_alv_variant
    *&      Form  sub_check_alv_variant
          to check whether a display variant exists
    FORM f_check_alv_variant  USING p_layvar TYPE disvariant-variant.
      CLEAR i_variant.
      i_variant-report   = sy-repid.
      i_variant-username = sy-uname.
      IF p_layvar NE space.
        MOVE p_layvar TO i_variant-variant.
    Checks whether a display variant exists
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = c_a
          CHANGING
            cs_variant = i_variant.
      ENDIF.
    ENDFORM.                    "f_check_alv_variant
    " sub_check_alv_variant
    *&      Form  f_fetch_vbak
    from to fetch sales org, dis chanel,sales group sold to party from vbak
    FORM f_fetch_vbak .
    *{ begin of change DRFK904686
      IF i_vbuk IS NOT INITIAL.
        SELECT vbeln
               auart
               vkorg
               vtweg
               vkgrp
               bstnk
               kunnr
          FROM vbak
          INTO TABLE i_vbak
             FOR ALL ENTRIES IN i_vbuk
         WHERE vbeln EQ i_vbuk-vbeln
           AND auart IN s_auart
           AND vkorg IN s_vkorg
           AND vtweg IN s_vtweg
           AND kunnr IN s_kunrsl  .
    end of change DRFK904686 }
        IF sy-subrc EQ 0.
          SORT i_vbak BY vbeln.
        ELSE.
          MESSAGE s000 WITH 'No documents found for the  selection criteria'(019).
          EXIT.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_fetch_vbak
    *&      Form  f_fetch_vbuk
      from to fetch open sales doc from vbuk
    FORM f_fetch_vbuk .
    IF i_vbak IS NOT INITIAL.
       SELECT vbeln
         FROM vbuk
         INTO TABLE i_vbuk
          FOR ALL ENTRIES IN i_vbak
        WHERE vbeln EQ i_vbak-vbeln
          AND ( lfstk NE 'C'
          OR    fkstk NE 'C' ) .
      SELECT vbeln
             lfstk               
             lfgsk       
             fkstk            FROM vbuk
        INTO TABLE i_vbuk
       WHERE ( ( lfstk EQ 'A'
         OR lfstk EQ 'B')
         OR (  fkstk EQ 'A'
         OR    fkstk EQ 'B' ) ) .
    ENDIF.
    ENDFORM.                    " f_fetch_vbuk
    *&      Form  f_fetch_vbpa
         from to fetch ship to party from vbpa
    FORM f_fetch_vbpa .
      IF i_vbak IS NOT INITIAL.
        SELECT vbeln
               kunnr
          FROM vbpa
          INTO TABLE i_vbpa
           FOR ALL ENTRIES IN i_vbak
         WHERE vbeln EQ i_vbak-vbeln
           AND kunnr IN s_kunrsh
           AND parvw EQ c_sh.
      ENDIF.
    ENDFORM.                    " f_fetch_vbpa
    *&      Form  f_fetch_vbap
      from to fetch sales doc, mat no, mat group,order UOM from vbap
    FORM f_fetch_vbap .
      IF i_vbpa IS NOT INITIAL.
        SELECT vbeln
               posnr
               matnr
               matkl
               kwmeng
               vrkme
               zmeng
               zieme
               netwr
               netpr
          FROM vbap
          INTO TABLE i_vbap
           FOR ALL ENTRIES IN i_vbpa
         WHERE vbeln EQ i_vbpa-vbeln
           AND matnr IN s_matnr.
      ENDIF.
    ENDFORM.                    " f_fetch_vbap
    *&      Form  f_fetch_makt
    form to fetch the material description
    FORM f_fetch_makt .
      IF i_vbap IS NOT INITIAL.
        SELECT
            matnr
            maktx
       FROM makt
          INTO TABLE i_makt
           FOR ALL ENTRIES IN i_vbap
         WHERE matnr EQ i_vbap-matnr
           AND spras EQ c_en.
      ENDIF.
    ENDFORM.                    " f_fetch_makt
    *&      Form  f_fetch_t023t
       form to fetch the material group description
    FORM f_fetch_t023t .
      IF i_vbap IS NOT INITIAL.
        SELECT
            matkl
            wgbez
       FROM t023t
          INTO TABLE i_t023t
           FOR ALL ENTRIES IN i_vbap
         WHERE spras EQ c_en
           AND matkl EQ i_vbap-matkl.
      ENDIF.
    ENDFORM.                    " f_fetch_t023t
    *&      Form  f_fetch_kna1
       form to fetch the sold to customer name
    FORM f_fetch_knasl .
      IF i_vbak IS NOT INITIAL.
        SELECT
            kunnr
            name1
       FROM kna1
          INTO TABLE i_knasl
           FOR ALL ENTRIES IN i_vbak
         WHERE kunnr EQ i_vbak-kunrsl.
      ENDIF.
    ENDFORM.                    " f_fetch_kna1
    *&      Form  f_fetch_knash
       form to fetch the ship to customer name
    FORM f_fetch_knash .
      IF i_vbpa IS NOT INITIAL.
        SELECT
            kunnr
            name1
       FROM kna1
          INTO TABLE i_knash
           FOR ALL ENTRIES IN i_vbpa
         WHERE kunnr EQ i_vbpa-kunrsh.
      ENDIF.
    ENDFORM.                    " f_fetch_knash
    *&      Form  f_move_final
    form for moving all the fields into the final internal table for
    *dispalying the final output.
    FORM f_move_final .
      SORT : i_vbak  BY vbeln,
             i_vbpa  BY vbeln,
             i_makt  BY matnr,
             i_t023t BY matkl,
             i_knasl BY kunnr,
             i_vbuk  BY vbeln,
             i_knash BY kunnr.
    *looping at i_vbap and moving mat no,mat group,quantity and
    *UOM into final table.
      LOOP AT i_vbap INTO st_vbap.
        IF st_vbap-kwmeng IS INITIAL.
          st_vbap-kwmeng = st_vbap-zmeng.
          st_vbap-vrkme  = st_vbap-zieme.
        ENDIF.
        MOVE: st_vbap-matnr  TO st_final-matnr,
              st_vbap-matkl  TO st_final-matkl,
              st_vbap-kwmeng TO st_final-kwmeng,
              st_vbap-netwr  TO st_final-netwr,
              st_vbap-vrkme  TO st_final-vrkme.
        IF p_meins IS INITIAL.
          MOVE:st_vbap-vrkme  TO st_final-zmein ,
               st_vbap-kwmeng TO st_final-zmenge.
        ELSE.
          CLEAR : w_kwmeng,
                  w_meins,
                  w_zmein.
    *Order Quantity
          w_kwmeng = st_vbap-kwmeng.
    *Order Unit
          w_meins = st_vbap-vrkme.
    *Report Unit
          w_zmein = p_meins.
          CLEAR : w_umrez1,
                  w_umren1,
                  w_umrez2,
                  w_umren2.
          SELECT SINGLE umrez
                        umren
                  INTO (w_umrez1,
                        w_umren1)
                   FROM marm
                  WHERE matnr EQ st_vbap-matnr
                    AND meinh EQ w_meins.
          SELECT SINGLE umrez
                        umren
                  INTO (w_umrez2,
                        w_umren2)
                   FROM marm
                  WHERE matnr EQ st_vbap-matnr
                    AND meinh EQ w_zmein.
          IF w_umrez1 IS NOT INITIAL AND w_umren2 IS NOT INITIAL.
            w_zmenge = w_kwmeng * ( w_umren1 / w_umrez1 ) * ( w_umrez2 / w_umren2 ).
        update new report unit and quantity
            MOVE p_meins  TO st_final-zmein.
            MOVE w_zmenge TO st_final-zmenge.
          ELSE.
       if failed to convert update report unit and quantity with order values
            MOVE st_vbap-vrkme TO st_final-zmein.
            MOVE st_vbap-kwmeng TO st_final-zmenge.
          ENDIF.
        ENDIF.
    Start of changes DRFK904686
    To get the delivery, overall and billing status
        CLEAR st_vbuk.
        READ TABLE i_vbuk INTO st_vbuk
                    WITH KEY vbeln = st_vbap-vbeln
                    BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE : st_vbuk-lfstk TO st_final-lfstk,
                 st_vbuk-lfgsk TO st_final-lfgsk,
                 st_vbuk-fkstk TO st_final-fkstk.
        ENDIF.
    End of changes DRFK904686
    *reading i_vbak and moving sales doc,sales org,dist chanel,
    *sales group,and sold to party into the final internal table
        CLEAR st_vbak.
        READ TABLE i_vbak
              INTO st_vbak
          WITH KEY vbeln = st_vbap-vbeln
          BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE: st_vbak-vbeln  TO st_final-vbeln ,
                st_vbak-vkorg  TO st_final-vkorg ,
                st_vbak-vtweg  TO st_final-vtweg ,
                st_vbak-vkgrp  TO st_final-vkgrp ,
                st_vbak-auart  TO st_final-auart ,
                st_vbak-bstnk  TO st_final-bstnk , "DRFK904686(+)
                st_vbak-kunrsl TO st_final-kunrsl.
        ENDIF.
    *reading i_vbpa and moving ship to party to the final internal table
        CLEAR st_vbpa.
        READ TABLE i_vbpa
              INTO st_vbpa
          WITH KEY vbeln = st_vbap-vbeln
          BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_vbpa-kunrsh TO st_final-kunrsh.
        ENDIF.
    *reading i_makt and moving material description to the final table
        CLEAR st_makt.
        READ TABLE i_makt
                  INTO st_makt
              WITH KEY matnr = st_vbap-matnr
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_makt-maktx TO st_final-maktx.
        ENDIF.
    *reading i_t023t
        CLEAR st_t023t.
        READ TABLE i_t023t
                  INTO st_t023t
              WITH KEY matkl = st_vbap-matkl
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_t023t-wgbez TO st_final-wgbez.
        ENDIF.
    *READINGI_KNASL
        CLEAR st_knasl.
        READ TABLE i_knasl
                  INTO st_knasl
              WITH KEY kunnr = st_final-kunrsl
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_knasl-name1 TO st_final-name1.
        ENDIF.
    *READINGI_KNASH
        CLEAR st_knash.
        READ TABLE i_knash
                  INTO st_knash
              WITH KEY kunnr = st_final-kunrsh
              BINARY SEARCH.
        IF sy-subrc EQ 0.
          MOVE st_knash-name1 TO st_final-name2.
        ENDIF.
        APPEND st_final TO i_final.
        CLEAR st_final.
      ENDLOOP.
    ENDFORM.                    " f_move_final
    *&      Form  f_build_fieldcat
    form for building the field catalog
    FORM f_build_fieldcat .
      m_fieldcat 'VKORG'   'VBAK'   'Sales Organisation'(004)   'Sales Organisation'(004)                     ' '.
      m_fieldcat 'VTWEG'   'VBAK'   'Distribution Channel'(005) 'Distribution Channel'(005)                   ' '.
      m_fieldcat 'VKGRP'   'VBAK'   'Sales Group'(008)          'Sales Group'(008)                            ' '.
      m_fieldcat 'VBELN'   'VBAK'   'Sales Document'(009)       'Sales Document'(009)                         ' '.
      m_fieldcat 'AUART'   'VBAK'   'Order Type'(026)           'Order Type'(026)                             ' '.
      m_fieldcat 'BSTNK'   'VBAK'   'PO number'(031)            'PO number'(031)                              ' '.
      m_fieldcat 'KUNRSL'  'VBAK'   'Sold to Party'(010)        'Sold to Party'(010)                          ' '.
      m_fieldcat 'NAME1'   'KNA1'   'Name Sold to'(020)         'Name Sold to'(020)                           ' '.
      m_fieldcat 'KUNRSH'  'VBPA'   'Ship to Party'(011)        'Ship to Party'(011)                          ' '.
      m_fieldcat 'NAME2'   'KNA1'   'Name Ship to'(022)         'Name Ship to'(022)                           ' '.
      m_fieldcat 'KWMENG'  'VBAP'   'Order Quantity'(012)       'Order Quantity'(012)                 'QUAN '(014).
      m_fieldcat 'VRKME'   'VBAP'   'Order UOM'(017)            'Order UOM'(017)                               ' '.
      m_fieldcat 'ZMENGE'  'VBAP'   'Report Quantity'(013)      'Report Quantity'(013)                'QUAN '(014).
      m_fieldcat 'ZMEIN'   'VBAP'   'Report UOM'(018)           'Report UOM'(018)                              ' '.
      m_fieldcat 'NETWR'   'VBAP'   'Net value'(030)            'Net value'(030)                               ' '.
    m_fieldcat 'MATKL'   'VBAP'   'Material Group Description'(023)    'Material Group Description'(023)    ' '. "DRFK904686(-)
    m_fieldcat 'WGBEZ'   'T023T'  'Material Group'(015)       'Material Group'(015)                         ' '. "DRFK904686(-)
      m_fieldcat 'MATKL'   'VBAP'   'Material Group'(015)       'Material Group'(015)                          ' '. "DRFK904686(+)
      m_fieldcat 'WGBEZ'   'T023T'  'Material Group Description'(023)    'Material Group Description'(023)     ' '. "DRFK904686(+)
      m_fieldcat 'MATNR'   'VBAP'   'Material Number'(016)      'Material Number'(016)                         ' '.
      m_fieldcat 'MAKTX'   'MAKT'   'Materia Description'(024)  'Material Description'(025)                    ' '.
    Begin of addition DRFK904686
      m_fieldcat 'LFSTK'   'VBUK'   'Delivery status'(027)         'Delivery status'(027)  'DelStat'           .
      m_fieldcat 'LFGSK'   'VBUK'   'Overall delivery status'(028) 'Overall delivery status'(028)              ' '.
      m_fieldcat 'FKSTK'   'VBUK'   'Billing status'(029)          'Billing status'(029)                       ' '.
    End of addition DRFK904686
    ENDFORM.                    " f_build_fieldcat
    *&      Form  f_list_dispaly
    form for displaying the final output in the Alv grid
    FORM f_list_dispaly .
      st_layout-cell_merge        = 'X'.
      st_layout-colwidth_optimize = 'X'.
    To display the required data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active    = 'X'
          i_callback_program = w_repid
          is_layout          = st_layout
          it_fieldcat        = i_fieldcat[]
          i_save             = 'A'
          is_variant         = i_variant
          it_events          = w_events[]
        TABLES
          t_outtab           = i_final.
    ENDFORM.                    " f_list_dispaly
    " f_EVENTTAB_BUILD
          FORM F_DISPLAY_TOP_OF_PAGE                                    *
    *form for providing the report heading                                *
            event     TOP_OF_PAGE                                       *
    FORM f_display_top_of_page.                                 "#EC CALLED
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = w_list_top_of_page.
    ENDFORM.                    "DISPLAY_TOP_OF_PAGE
    *&      Form  f_EVENTTAB_BUILD
            Ereignistabelle Bilden
            EVENTS TABLE BUILD
         -->U_ER_EVENTS[]  text
    FORM f_eventtab_build USING p_u_er_events TYPE slis_t_event.
      FIELD-SYMBOLS: <fs_event> TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_u_er_events.
      READ TABLE p_u_er_events WITH KEY name = slis_ev_top_of_page
                             ASSIGNING <fs_event>.
      IF sy-subrc = 0.
        <fs_event>-form = c_formname_top_of_page.
      ENDIF.
    ENDFORM.                               " f_EVENTTAB_BUILD
    *&      Form  F_COMMENT_BUILD
           Bearbeitung des Listenkopfes
           Processing of listheader
         -->U_ER_LIST_TOP_OF_PAGE[]  text
    FORM f_comment_build USING u_er_list_top_of_page TYPE slis_t_listheader.
      DATA: lw_line TYPE slis_listheader.
    Type H
      CLEAR lw_line.
      lw_line-typ  = 'H'.
    Daily Historical Volume
      lw_line-info = text-003.
      APPEND lw_line TO u_er_list_top_of_page.
    Type S
      CLEAR lw_line.
      lw_line-typ  = 'S'.
    Run Date - Sy-datum
      WRITE sy-datum TO w_datum MM/DD/YY .
      CONCATENATE text-021 w_datum INTO w_text.
      lw_line-info = w_text.
      APPEND lw_line TO u_er_list_top_of_page.
    ENDFORM.                               " COMMENT_BUILD
    Reward the points for useful answers.

  • E-mail of PDF issue TLINE structure but SOLISTI1 needed

    Hi,
    So far I have done the following. I have prepared a SMARTFORM and an ABAP. My ABAP calls the Smartform and gives the data to the function module “CONVERT_OTF”. This function creates a PDF file from the Smartform data. The output of "CONVERT_OTF" is a table with the format of structure “TLINE”. In a first step I save these data into a PDF file with the function module "GUI_DOWNLOAD".
    Now the issue.
    In the second step I am trying to send the output with the function “SO_DOCUMENT_SEND_API1”. The function is recommended by SAP for release 6.4 instead of the former function "SO_NEW_DOCUMENT_ATT_SEND_API1".
    The attachment must be delivered either with the structure “SOLISTI1” or “SOLIX” to be sent with the e-mail function “SO_DOCUMENT_SEND_API1”. I have tried to put my data with structure TLINE into the function. In these case I get short dumps. If I put the output of the function “CONVERT_OTF” in a table with the format “SOLISTI1” instead of a table with structure “TLINE” a PDF file is still created and also send out with the e-mail function, but the file can’t be opened anymore. Acrobat delivers an error message that the file is damaged.
    I have tried to convert the file with structure TLINE in a hexadecimal file with structure SOLIX. For this purpose I used the function “TABLE_COMPRESS”. This worked fine. But the file which has been sent by the e-mail was still damaged. Even if I have downloaded the file I got the message that the file was damaged.
    Are there any other suggestions how the attachment could be sent instead of using the function “SO_DOCUMENT_SEND_API1”? Is there a function available, which could be used to sent attachments with structure TLINE? Or are there any suggestions, how I can convert my smartform output in a SOLIX or SOLISTI1 structure?
    Thank you and best regards
    Karsten

    Hi Arold,
    <b>1</b>.
    Have a look at this program.
    This program is sending PDF file as attachment thru mail
    <b>2</b>.
    REPORT  zvenkat_mail.
    TABLES :
       tsp01.
    Itabs and variables .
    *Tables
    DATA:
       BEGIN OF i_mard OCCURS 0,
         matnr TYPE mard-matnr,
         werks TYPE mard-werks,
         lgort TYPE mard-lgort,
         labst TYPE mard-labst,
         umlme TYPE mard-umlme,
         insme TYPE mard-insme,
         einme TYPE mard-einme,
       END OF i_mard.
    DATA :
       g_sy_spono LIKE sy-spono.
    Mail related Variables and i tabs.
    DATA:
       w_subject       LIKE sodocchgi1,
       i_pack_list     LIKE sopcklsti1 OCCURS  1  WITH HEADER LINE,
       i_objhead       LIKE solisti1   OCCURS  1  WITH HEADER LINE,
       i_contents_text LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_cont_bin      LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_objhex        LIKE solix      OCCURS 10  WITH HEADER LINE,
       i_receiver      LIKE somlreci1  OCCURS  1  WITH HEADER LINE,
       i_listobject    LIKE abaplist   OCCURS  1  WITH HEADER LINE,
       pdf             LIKE tline      OCCURS 100 WITH HEADER LINE,
       content_out     LIKE solisti1   OCCURS 0 WITH HEADER LINE.
    DATA:
       tab_lines       TYPE i,
       doc_size        TYPE i,
       att_type        LIKE soodk-objtp,
       obj_desc        LIKE w_subject-obj_descr,
       sent_to_all     LIKE sonv-flag,
       client          LIKE tst01-dclient,
       name            LIKE tst01-dname,
       objtype         LIKE rststype-type,
       type            LIKE rststype-type,
       is_otf          TYPE c ,
       no_of_bytes     TYPE i,
       pdf_spoolid     LIKE tsp01-rqident,
       jobname         LIKE tbtcjob-jobname,
       jobcount        LIKE tbtcjob-jobcount,
       pn_begda        LIKE sy-datum,
       val(1)          TYPE c,
       pripar          TYPE pri_params,
       arcpar          TYPE arc_params,
       lay             TYPE pri_params-paart,
       lines           TYPE pri_params-linct,
       cols            TYPE pri_params-linsz,
       spool_name      TYPE pri_params-plist.
    *&      START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM get_data_from_database.
      PERFORM output_for_pdf.
    *&      END-OF-SELECTION.
    END-OF-SELECTION.
      PERFORM send_mail..
    *&      Form  get_data_from_database
    FORM get_data_from_database .
      SELECT matnr
             werks
             lgort
             labst
             umlme
             insme
             einme
        FROM mard
        INTO TABLE i_mard
        UP TO 20 ROWS.
    ENDFORM.                    " get_data_from_database
    *&      Form  output_for_pdf
    FORM output_for_pdf .
      PERFORM get_print_params.
      LOOP AT i_mard.
        WRITE:/ sy-vline, i_mard-matnr,
                sy-vline, i_mard-werks,
                sy-vline, i_mard-lgort,
                sy-vline, i_mard-labst,
                sy-vline, i_mard-umlme,
                sy-vline, i_mard-insme,
                sy-vline, i_mard-einme,
                sy-vline.
      ENDLOOP.
      ULINE .
      g_sy_spono = sy-spono.
      NEW-PAGE PRINT OFF.
      CALL FUNCTION 'ABAP4_COMMIT_WORK'.
    ENDFORM.                    " output_for_pdf
    *&      Form  send_mail
    FORM send_mail .
      PERFORM mail_without_attachment.
      PERFORM mail_with_pdf_attachment.
      PERFORM mail_with_exel_attachment.
      PERFORM mail_with_text_attachment.
    ENDFORM.                    " send_mail
    *&      Form  mail_with_pdf_attachment
    FORM mail_with_pdf_attachment .
      CLEAR :w_subject,
             sent_to_all,
             i_pack_list[],
             i_objhead[],
             i_cont_bin[],
             i_contents_text[],
             i_receiver[].
      i_cont_bin = '  |  '.
      APPEND i_cont_bin.
    Subject of the mail.
      obj_desc  = 'Hello SDN Friends ' .
      w_subject-obj_name  = 'MAIL_ALI'.
      w_subject-obj_descr = obj_desc.
    Body of the mail
      DATA :head_desc LIKE i_contents_text,
            body_desc LIKE i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE
      'This mail has been generated for Test purpose.'
      'Please dont hesitate to ask any type of question in the forum.'
      INTO body_desc
      SEPARATED BY space.
      i_contents_text = body_desc.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CLEAR body_desc.
      i_contents_text = 'Thank You.'.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      i_contents_text = 'Fellow SDN member,'.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      i_contents_text = 'Venkat.O'.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE '(Note: This is system generated message, please'
                  'do not reply'
                  'to this Email.)'
               INTO i_contents_text
               SEPARATED BY space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
    Write Packing List (Body)
      DESCRIBE TABLE i_contents_text LINES tab_lines.
      READ     TABLE i_contents_text INDEX tab_lines.
      w_subject-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
      i_contents_text ).
      CLEAR i_pack_list-transf_bin.
      i_pack_list-head_start = 1.
      i_pack_list-head_num   = 0.
      i_pack_list-body_start = 1.
      i_pack_list-body_num   = tab_lines.
      i_pack_list-doc_type   = 'RAW'.
      APPEND i_pack_list.
      CLEAR  i_pack_list.
    Create receiver list
      i_receiver-receiver = '[email protected]'..
      i_receiver-rec_type = 'U'.
      APPEND i_receiver.
      CLEAR  i_receiver.
    Select query for Spool requests
      REFRESH content_out.
      IF sy-subrc = 0.
        SELECT  SINGLE *
          FROM  tsp01
          WHERE rqident = g_sy_spono.
        IF sy-subrc <> 0.
          MESSAGE s000(0k) WITH 'Spool Number does not exist'.
          EXIT.
        ELSE.
          client = tsp01-rqclient.
          name   = tsp01-rqo1name.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
        EXPORTING
          authority     = 'SP01'
          client        = client
          name          = name
          part          = 1
        IMPORTING
          type          = type
          objtype       = objtype
        EXCEPTIONS
          fb_error      = 1
          fb_rsts_other = 2
          no_object     = 3
          no_permission = 4
          OTHERS        = 5.
      IF objtype(3) = 'OTF'.
        is_otf = 'X'.
      ELSE.
        is_otf = space.
      ENDIF.
    Convert Spool job to PDF
      IF is_otf = 'X'.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = tsp01-rqident "Spool req number
            no_dialog                = ' '
          IMPORTING
            pdf_bytecount            = no_of_bytes
            pdf_spoolid              = pdf_spoolid
            btc_jobname              = jobname
            btc_jobcount             = jobcount
          TABLES
            pdf                      = pdf
          EXCEPTIONS
            err_no_otf_spooljob      = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_dstdevice        = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12.
        CASE sy-subrc.
          WHEN 0.
          WHEN 1.
            MESSAGE s000(0k) WITH 'No OTF Spool Job'.
            EXIT.
          WHEN 2.
            MESSAGE s000(0k) WITH 'Spool Number does not exist'.
            EXIT.
          WHEN 3.
            MESSAGE s000(0k) WITH 'No permission for spool'.
            EXIT.
          WHEN OTHERS.
            MESSAGE s000(0k) WITH 'Error in Function CONVERT_OTFSPOOLJOB_2_PDF'.
            EXIT.
        ENDCASE.
      ELSE.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = tsp01-rqident
            no_dialog                = ' '
          IMPORTING
            pdf_bytecount            = no_of_bytes
            pdf_spoolid              = pdf_spoolid
            btc_jobname              = jobname
            btc_jobcount             = jobcount
          TABLES
            pdf                      = pdf
          EXCEPTIONS
            err_no_abap_spooljob     = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_destdevice       = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12.
        CASE sy-subrc.
          WHEN 0.
          WHEN 1.
            MESSAGE s000(0k) WITH 'No ABAP Spool Job'.
            EXIT.
          WHEN 2.
            MESSAGE s000(0k) WITH 'Spool Number does not exist'.
            EXIT.
          WHEN 3.
            MESSAGE s000(0k) WITH 'No permission for spool'.
            EXIT.
          WHEN OTHERS.
            MESSAGE s000(0k)
               WITH 'Error in Function CONVERT_ABAPSPOOLJOB_2_PDF'.
            EXIT.
        ENDCASE.
      ENDIF.
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_src              = 134
          line_width_dst              = 255
        TABLES
          content_in                  = pdf
          content_out                 = content_out
        EXCEPTIONS
          err_line_width_src_too_long = 1
          err_line_width_dst_too_long = 2
          err_conv_failed             = 3
          OTHERS                      = 4.
      IF sy-subrc <> 0.
        MESSAGE s000(0k) WITH 'Conversion Failed'.
        EXIT.
      ENDIF.
    ---------------------Create Message Attachment
      DESCRIBE TABLE i_cont_bin LINES tab_lines.
      i_pack_list-transf_bin = 'X'.
      i_pack_list-head_start = tab_lines + 1.
      i_pack_list-head_num   = 0.
      i_pack_list-body_start = tab_lines + 1.
      APPEND LINES OF content_out[] TO i_cont_bin[].
      DESCRIBE TABLE content_out LINES tab_lines.
      i_pack_list-doc_size =  tab_lines * 255.
      i_pack_list-body_num = tab_lines.
      i_pack_list-doc_type = 'PDF'.
      i_pack_list-obj_name = 'ATTACHMENT'.
      i_pack_list-obj_descr = 'Materials and their Quantities' .
      APPEND i_pack_list.
      CLEAR  i_pack_list.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_subject
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = i_pack_list
          object_header              = i_objhead
          contents_bin               = i_cont_bin
          contents_txt               = i_contents_text
          receivers                  = i_receiver
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc NE 0.
      ENDIF.
    ENDFORM.                    " mail_with_pdf_attachment
    *&      Form  get_print_params
    FORM get_print_params .
      lay = 'X_65_132'.
      lines = 65.
      cols  = 132.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          in_archive_parameters  = arcpar
          in_parameters          = pripar
          layout                 = lay
          line_count             = lines
          line_size              = cols
          no_dialog              = 'X'
        IMPORTING
          out_archive_parameters = arcpar
          out_parameters         = pripar
          valid                  = val
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF val <> space AND sy-subrc = 0.
        pripar-prrel = space.
        pripar-primm = space.
        NEW-PAGE PRINT ON
          NEW-SECTION
          PARAMETERS pripar
          ARCHIVE PARAMETERS arcpar
          NO DIALOG.
      ENDIF.
    ENDFORM.                    " get_print_params
    I hope it helps u .
    <b>Thanks,
    Venkat.O</b>

  • Unable to connect to Services Registry(error) while connecting from NWDS

    Hi SDN friends,
    I am trying to do WSDL import from NWDS (Developer Studio SAP NetWeaver 7.1 Composition Environment SP03 PAT0000 Build id: 200710302120 ) and i am getting  following error
    "Unable to connect to Services Registry"
    Below are  the service regsitry details i am passing
    window --> Preferences
    Service Registry (UDDI Service)
    Server Name:sr.esworkplace.sap.com
    Server Port:sr.esworkplace.sap.com
    Server Port:50000
    Server HTTPS Port:50043
    Inquiry Path:uddi/api/inquiry
    Publish Path:uddi/api/publish
    Security Path:uddi/api/security
    Classification Service
    Server Name:sr.esworkplace.sap.com
    Server Port:50000
    Server HTTPS Port:50043
    Classification Path:ClassificationService/CS?style=document
    I am using the following credentials for login to UDDI Service http://sr.esworkplace.sap.com
    login/pwd: sruser
    password: esword123
    I tried  with two different systems (office and Home) , bit still not connecting.
    Waiting for experts answer.
    Thanks
    Aravinda

    Hi,
    You wrote that you connect to the SAP uddi:
    Service Registry (UDDI Service)
    Server Name:sr.esworkplace.sap.com
    Server Port:sr.esworkplace.sap.com
    Server Port:50000
    Server HTTPS Port:50043
    Inquiry Path:uddi/api/inquiry
    Publish Path:uddi/api/publish
    Security Path:uddi/api/security
    sr.esworkplace.sap.com is not on your home pc. Its a SAP public uddi.
    If you want to connect to your own pc than your configuration would be sompething like this:
    Server Name:localhost
    Server Port:50000
    Server HTTPS Port:50043
    Inquiry Path:uddi/api/inquiry
    Publish Path:uddi/api/publish
    Security Path:uddi/api/security
    And you shouldn't use this login data
    login/pwd: sruser
    password: eswork123
    regards,
    v s
    Edited by: v s on Jul 2, 2008 9:31 AM
    Edited by: v s on Jul 2, 2008 9:34 AM

  • Re-using planning objects

    Hi SDN friends,
    I have an existing implementation configured.
    Now, there is a need to customise the loading for new companies.
    So, this means existing solution implemented already must not be changed.
    I think I will base on existing solution.
    Is it possible to create another set of bps customizing based on the existing solution and using the same planning objects? But existing customizing must not be changed or touched.
    for example, can i create another planning area using the same planning objects under existing planning area?
    Please advise me, thanks.
    Regards
    Sanjay

    Dear,
    if you want to create new one then solution given by Vlad Stulikov  is good.
    If you want to used existing objects only and only for reporting purpose, somewhere else, you can go for multiplanning are.
    hope this will help you.
    Regards
    Vinay

  • No suitable sender agreement found - File / Adapter, Sender FTP

    Hi SDN Friends,
    Is my first time in PI with FTP / FILE ( really I'm newbie in PI - but 2 years in ABAP ).
    I have configurated my communication channel with and FILE/ADAPTER on a Sender FTP...
    I have Tried with 2 FTP, one in my PC, and one Public... but in both cases, it's doesn't works... monitoring my communication channel, I get the No suitable sender agreement found ERROR....
    I thought... may be PI has not access to the FTP's servers, so run in SAP PI server, an ABAP program trx se38, program: RSFTP002 and with this, I could connect to the FTP...  it works perfectly.
    so I don't understand... what I'm doing bad?
    Any Help?
    regards every body!

    u r welcome...2 yrs back i am newbie
    when ever we make changes after an error, sometimes XI will not take the changes in cache automatically; uses old one. solution for this is complete Cache refresh.
    welcome to Integration World have fun....

  • Base run time exception

    hi sdn friends,
    I am doing idoc to file scenario. While mapping in static test it was giving successful message. where as in the tcode sxmb_moni i am getting the run time exception in mapping. The error is
    During the application mapping com/sap/xi/tf/_WBBDLD_TO_ITEM_MASTER_MM_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</
    Can any one give me the suggestion how to solve this problem
    Thanks in advance
    - Vasu

    Hi,
    Copy the payload from SXMB_MONI and test your mapping using this payload.
    Check this blog for this,
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    Regards,
    Bhavesh

  • User Logic for Conversion Type Instead of Hard coding in query.

    Hello , Good response from SDN but thats all standard which I know. Please help me to resolve the problem as stated below. SDN friends are always best help.
    Requirement: User will select the Target Currency; Will select the Exchange Rate like Monthly Avg 002M. Now there has to be a variable in Conversion which tells the logic to pick Conversion Type ZVHGR if  Exchange Rate = 002M, but if Exchange Rate = 001, then Conversion Type ZVHMR.
    <u><b>
    Approach to solve abo</b></u>ve
    1. I have created a Currency Translation Type " FiscperConversion" "ZVHGR" now this has Exchange Rate Type from Variable "ZVARN" (Which is a variable single value manual input on 0RTYPE Infoobject for exchange rate.)
    2. Now Currency Tab: Target Currency is selected from Variable placed in the Report. ZRPVAR.
    3. Now the Variable Time Reference is used. Standard Infoobject 0FISCPER
    which is beginning of period.
    Now all the above is done. Let go to the query and For Value of kEYFIGURE "Audit Balance" in Conversion Tab Conversion Type is specified is "FiscperConversion" ZVHGR"same as above and thats it. But the problem is here user want a variable that user can select the Conversion Type Instead of Hard coding.
    <b>Please suggest how to create this variable for Conversion Type and specify in query designer since In Conversion Tab this is not allowed to have variable.</b>
    Please help me very soon
    Thanks
    Soniya Kapoor
    null

    Hello soniya
    CTK ( currency translation key) includes
    1. Exchange rate type - variable
    2. Time base              - Variable
    3. Source abd TGT currency    - variable
    if all the things are given in variable why and what extra you need by selecting currency translation key from user input. I think you should ask business user again abt their requirement.
    I can think of inputing CTK if say you have choosen time base as static ( Fix value)...say in one key u r using fiscal period as base and in other u r using calday as base...
    Thanks
    Tripple k

  • Link Source reports in BIXI3.0 to Target report

    Hello Friends Please help me resolve this i will be grateful to all sdn friends if you can help me with this
    I have two reports 1. Trial Balance 2. Trial  based on OLAP BI Infocube universes. I want to Jump from Trial Balance to "Trial" Report by clicking on the GL Account from Source report "Trial Balance" to Target report = "Trial"
    I right clicked and in New Hyperlink I put this code
    Spath is for the Folder since reports are in my favorites . if this is not required please sugget
    aLL Reports in webi has this kind of link so please me how to make the correct hyperlink
    http://nbc-tst-bibo-01:8080/InfoViewApp/listing/main.do?appKind=InfoView&service=%2FInfoViewApp%2Fcommon%2FappService.do&loc=&initialFolderId=null
    Please send me the link to BO XI 3.0 Open document url which I have for xi2.0 but i think its not working
    URL Incorrect format
    u201C<a \u201Chref=http://nbc-tst-bibo-01:8080/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp&sType=wid&sPath=My Favorites,Trial,&sDocName=Trial&sRefresh=Y&lsSG/L Account Key=u201D[G/L Account Key] \u201D>[G/L Account Key]u201D
    Also I tried the below which does not work
    ='<a href=http://nbc-tst-bibo-01:8080/businessobjects/enterprise115/desktoplaunch/jsp/aa-open-inlist.jsp?url=http://nbc-tst-bibo-01:8080/businessobjects/enterprise115/desktoplaunch/jsp/openAnalytic.jsp?DocumentExt=wid&DocumentId=Trial&mode=full&sWindow=New&nbPrompts=1&lsSG/L Account Key='[G/L Account Key]' target=hiddenFrame>''Click Here''</a>'
    Edited by: soniya kapoor on Nov 10, 2008 12:59 AM

    Hi Soniya,
    These are the steps:
    1. Log in into infoview
    2. Change the preferences (Click in the Preference button in the main tool bar), in the WebIntelligence section change the Select a default view format: to Interactive.
    3. Click OK
    4. Open the report where you want to add the hyperlink
    5. Right click in the column or cell to add the hyperlink
    6. Click Hypelink > New
    7. You will see the Create Hypelink window, click Browse the select which report do you want to link
    8. Fill in the parameter, prompts, etc.
    and that's it, hope it's clear now. If you have any question let me know.

  • Incorrect focus using replacement bee in tableview

    Hello SDN friends,
    Situation: TableView cell with a checkbox replacement bee in one of the cells. When I tab within the tableview. The cursor is jumping to the next field. When I entered the field with the checkbox replacement bee the focus is place on the cell instead of focusing on the checkbox directly. We are working on the WAS 6.20 SP54.
    On another customers system WAS 6.20 SP30 it works fine.
    Does any encountered the same problem?
    Can it be fixed without using JavaScript?
    Best regards,
    Sander

    Hello SDN friends,
    Situation: TableView cell with a checkbox replacement bee in one of the cells. When I tab within the tableview. The cursor is jumping to the next field. When I entered the field with the checkbox replacement bee the focus is place on the cell instead of focusing on the checkbox directly. We are working on the WAS 6.20 SP54.
    On another customers system WAS 6.20 SP30 it works fine.
    Does any encountered the same problem?
    Can it be fixed without using JavaScript?
    Best regards,
    Sander

  • BEx Reporting Problem - Display not changing to Text

    Hi SDN Friends,
    I am working on a task of doing the "out of box" business content reporting on CRM activities, account and contact management ( CRM CIC ).
    But i installed the business content CRM activities reports in BW, extracted activities transactional data from CRM into BW ..maintained ODS for activities and doing reporting from the infocube.
    1. When i execute the report, the characteristics from master data table (eg: activity partner) is showing only numbers like 21,1 etc in the report.....i changed them to Text and Medium length text under Business explorer tab in RSD1..........in the BEx i right clicked on choose..display as "Name"..but still does not work.
    2. Also another issue is that, all the configuration keys in CRM are showing in the BW reports. please tell me how to avoid it?
    Please suggest me experts..
    Awaiting the reply at the earliest.
    Thanks
    Shreya

    Hi Shreya,
    Check this link you would would find all the datasources for activity. Load the texts based on the datasources.
    http://help.sap.com/saphelp_nw04/helpdata/en/61/ef4529577111d6b21500508b5d5211/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/091d3b24f7d923e10000000a11402f/frameset.htm
    Bye
    Dinesh

  • Exracting data from two tables existing in external database

    Hi SDN friends,
    I have 2 tables in external database system. I cannot create a view as I am using Netweaver Java Dictionary. I therefore would like to get the data on BI side & perform join there. TABLE1 & TABLE2 has many to many relationship.
    <b>TABLE1</b> - FieldA, FieldB
    <b>TABLE2</b> - FieldB, FieldC(texts)
    Please help me find the best approach to populate the data into the BI infoobjects.
    I assure I will give full points to anyone who replies.
    Thanks,
    Sunil

    Hi
    If you are having data into 2 infoobjects, then its as good as having data nto tables. So now the question comes, whts the scenario?
    You can use these twe infoobjects in ODS ..create update rule and so on....
    Sunil, I m not able to understand further whts the problem you are facing exactly....
    You want help with ODS or wht?
    If you want to have join on infobjects then we can go ahead with infosets...
    Plz expain problem so tht we can work ahead
    Regards
    Sorabh
    Dont forgot to assign points in SDN -****
    Message was edited by: Sorabh Arora

Maybe you are looking for

  • Upload data for Tcode LT06(Transfer order creation) using BDC -very urgent

    hi experts,       I got stucked up in writing a BDC for the Tcode LT06(Transfer order creation using wearhouse number) in MM module, the problem is like this, when i go to the tcode LT06 , it will ask for material doucument,mat. docu. year and wearho

  • BPM 11.1.1.6.0 gets confused in process tracking

    Hi, In my bpm model there are some steps where the same activity is repeated (any number of times) in other words the flow can return to a particular activity many times for example the flow could dictate that the activity "Document Review" was acces

  • Patch processing in OBIEE 11g

    Hi, Is there any document regarding patch processing for both catalog and rpd? I have seen some 2 to 3 blogs and tried executing the patch, but got some error in that they have mentioned to look *"the Oracle Business Intelligence Suite Enterprise Edi

  • How to return from WEBGUI to WDA?

    Dear Experts, i am in a tricky situation, and I hope you can help me with some wise advise. I have read dozens of threads, but still haven't found the absolute satisfying answer. The requirements: I am looking for a solution to call a SAP GUI Transac

  • Process chain with abap report

    Hi all, I have an abap report which is used to fill a table . This report is scheduled on daily basis . Now i want to do is , whenever this report completes my process chain should start in BI so that data in table can be filled in GDS . How to do th