Is it possible to get item details in column wise

Hi experts,
Is it possible to get dynamic columns in alv report output

Hello friend,
This information will help u i think..take a look below.
REPORT zcdf_dynamic_table.
Dynamic ALV Grid with Cell Coloring.
Build a field catalog dynamically and provide the ability to color
the cells.
To test, copy this code to any program name and create screen 100
as described in the comments. After the screen is displayed, hit
enter to exit the screen.
Tested in 4.6C and 6.20
DATA:
r_dyn_table TYPE REF TO data,
r_wa_dyn_table TYPE REF TO data,
r_dock_ctnr TYPE REF TO cl_gui_docking_container,
r_alv_grid TYPE REF TO cl_gui_alv_grid,
t_fieldcat1 TYPE lvc_t_fcat, "with cell color
t_fieldcat2 TYPE lvc_t_fcat, "without cell color
wa_fieldcat LIKE LINE OF t_fieldcat1,
wa_cellcolors TYPE LINE OF lvc_t_scol,
wa_is_layout TYPE lvc_s_layo.
FIELD-SYMBOLS:
<t_dyn_table> TYPE STANDARD TABLE,
<wa_dyn_table> TYPE ANY,
<t_cellcolors> TYPE lvc_t_scol,
<w_field> TYPE ANY.
START-OF-SELECTION.
Build field catalog based on your criteria.
wa_fieldcat-fieldname = 'FIELD1'.
wa_fieldcat-inttype = 'C'.
wa_fieldcat-outputlen = '10'.
wa_fieldcat-coltext = 'My Field 1'.
wa_fieldcat-seltext = wa_fieldcat-coltext.
APPEND wa_fieldcat TO t_fieldcat1.
wa_fieldcat-fieldname = 'FIELD2'.
wa_fieldcat-inttype = 'C'.
wa_fieldcat-outputlen = '10'.
wa_fieldcat-coltext = 'My Field 2'.
wa_fieldcat-seltext = wa_fieldcat-coltext.
APPEND wa_fieldcat TO t_fieldcat1.
Before adding cell color table, save fieldcatalog to pass
to ALV call. The ALV call needs a fieldcatalog without
the internal table for cell coloring.
t_fieldcat2[] = t_fieldcat1[].
Add cell color table.
CALENDAR_TYPE is a structure in the dictionary with a
field called COLTAB of type LVC_T_SCOL. You can use
any structure and field that has the type LVC_T_SCOL.
wa_fieldcat-fieldname = 'T_CELLCOLORS'.
wa_fieldcat-ref_field = 'COLTAB'.
wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
APPEND wa_fieldcat TO t_fieldcat1.
Create dynamic table including the internal table
for cell coloring.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat1
IMPORTING
ep_table = r_dyn_table
EXCEPTIONS
generate_subpool_dir_full = 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.
Get access to new table using field symbol.
ASSIGN r_dyn_table->* TO <t_dyn_table>.
Create work area for new table.
CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
Get access to new work area using field symbol.
ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
Get data into table from somewhere. Field names are
known at this point because field catalog is already
built. Read field names from the field catalog or use
COMPONENT <number> in a DO loop to access the fields. A
simpler hard coded approach is used here.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
<w_field> = 'ABC'.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
<w_field> = 'XYZ'.
APPEND <wa_dyn_table> TO <t_dyn_table>.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
<w_field> = 'TUV'.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
<w_field> = 'DEF'.
APPEND <wa_dyn_table> TO <t_dyn_table>.
Color cells based on your criteria. In this example, a test on
FIELD2 is used to decide on color.
LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
Get access to internal table used to color cells.
ASSIGN COMPONENT 'T_CELLCOLORS'
OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
CLEAR wa_cellcolors.
wa_cellcolors-fname = 'FIELD2'.
IF <w_field> = 'DEF'.
wa_cellcolors-color-col = '7'.
ELSE.
wa_cellcolors-color-col = '5'.
ENDIF.
APPEND wa_cellcolors TO <t_cellcolors>.
MODIFY <t_dyn_table> FROM <wa_dyn_table>.
ENDLOOP.
Display screen. Define screen 100 as empty, with next screen
set to 0 and flow logic of:
PROCESS BEFORE OUTPUT.
MODULE initialization.
PROCESS AFTER INPUT.
CALL SCREEN 100.
MODULE initialization OUTPUT
MODULE initialization OUTPUT.
Set up for ALV display.
IF r_dock_ctnr IS INITIAL.
CREATE OBJECT r_dock_ctnr
EXPORTING
side = cl_gui_docking_container=>dock_at_left
ratio = '90'.
CREATE OBJECT r_alv_grid
EXPORTING i_parent = r_dock_ctnr.
Set ALV controls for cell coloring table.
wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
Display.
CALL METHOD r_alv_grid->set_table_for_first_display
EXPORTING
is_layout = wa_is_layout
CHANGING
it_outtab = <t_dyn_table>
it_fieldcatalog = t_fieldcat2.
ELSE. "grid already prepared
Refresh display.
CALL METHOD r_alv_grid->refresh_table_display
EXPORTING
i_soft_refresh = ' '
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDIF.
ENDMODULE. " initialization OUTPUT

Similar Messages

  • Is it possible  to refine "Item as database column"  by post....

    hello
    Is it possible to refine "Item as database column" by post calculation regrading that it is not effected by update process
    number of items is more than I use query, as a result I would prefer use database column.
    regards
    Edited by: sak on Jul 5, 2010 12:00 PM
    Edited by: sak on Jul 5, 2010 12:01 PM
    Edited by: sak on Jul 5, 2010 12:05 PM

    If you perform any post calculation on a "database column" that amounts to a "change" in value and hence is detected as a change by the ApplyMRU process.
    You may have to write custom MRU for this where you handle the "meaning" of update the way you want it.
    Regards,

  • How to get item names as column headings???

    Hi,
    I've given all the items in my complex folder nice user-friendly names, which can be seen in Desktop and Plus, but when I pull them into a worksheet the column headings revert to the underlying column name. Also, in Plus the list of selected items shows this underlying column name while the list of items in the folder shows the user-friendly names! This is really confusing for users.
    Is there a way to get Disco to use the item names? Or do I have to go back to the underlying tables and views and recreate them with my user-friendly names?
    Thanks

    In Administrator when I look at the item properties, it shows my user-friendly item Name as the item Heading as well, but when I go into Desktop and pull the items into a worksheet, the worksheet column headings SOMETIMES default to the item Identifiers (or the underlying table/view column name in the item Formula), NOT the item Headings.
    Here's an example - I have 3 numerical items:
    1. Name and Heading are both "IP EL Spells", Identifier is "MONTHLY_ACT_EL", Formula is ""V pbc running totals 0406".Monthly act el"
    2. Name and Heading are both "IP EL Spells YTD", Identifier is "RUNNING_ACT_EL", Formula is ""V pbc running totals 0406".Running act el
    3. Name and Heading are both "IP EL Spells Prev YTD", Identifier is "PREV_ACT_EL", Formula is ""V pbc running totals 0406".Prev act el"
    When I pull these into a crosstab in Desktop to sum them, the column headers are:
    1. IP EL Spells SUM
    2. Running act el SUM 1
    3. Prev Act El SUM
    The first heading is correct, the second seems to be based on the Formula or Identifier but I don't know where the "1" comes from or why "act el" are in lower case, and the third also seems to be based on the Formula or Identifier, but in mixed case.
    I'm baffled!

  • Is it possibloe to get a detailed break down of my calls and sms that would include phone numbers?

    I am on a family plan and was wondering is it possible to get a detailed break down of my calls and sms that would include phone numbers for my line only?

    If you are the account owner, you can log into your My Verizon ccount online and view the usage details for all the lines on the account.  If you are only an account member, you should be able to view some details for your line, but I am not sure exactly how much.

  • Getting WebPage Details with JEditorPane

    I want to know that it is possible to get the details of the Web Page that is opened with using JEditorPane's setPage(String url) method.
    Details like -
    1.)Icon associated with the WebPage
    2.)Cookies Send by the WebPage
    3.)Certificates
    4.)Other Information

    thx for the reply... I tried that, I System.out.println() the code, it will give mi
    <html>
    <head>
    </html>
    So I use this
    Document doc = jeditor.getDocument();
    doc.getText(firstpos, lastpos);
    I have another question. How do I make use of the HTMLEditorKit.InsertHTMLTextAction class. I want to insert a table into the JEditorPane which contain a html page.
    Thanks in advance.

  • Tax value is differ in PO printpreview & Item details..urgent

    Hi guru's
    I created 1 PO with Tax code as 18 (12.5% RM Deductible).
    In print priview it is showing 12.5% deductible & 4% non deductible..
    But in PO item details - invoice column- Taxes -- it is showing only 12.5% deductible..
    please send me solution ..Urgent
    Thanks
    sap-mm

    Can u explain me detailed manner, wht would be problem..
    So that i can have clear idea about this issue ..
    Thanks
    sap-mm

  • Not getting output undr billing details and item details in printng invoice

    In form interface under import tab i have declared 1 value i.e. IM_FS_KNA1 type KNA1 I have not declared anything except this in form interface.
    In Global Definitions under Global Data tab:
    IM_T_KNA1     TYPE TABLE OF     KNA1
    IM_FS_VBRK     TYPE     VBRK
    IM_FS_VBRP     TYPE     VBRP
    W_TOTAL     TYPE     VBRP-NETWR
    IM_T_VBRK     TYPE TABLE OF     VBRK
    IM_T_VBRP     TYPE TABLE OF     VBRP
    under Currency/ Quant Fields
    IM_FS_VBRP-NETWR     IM_FS_VBRK-WAERK     C CURR
    In Billin Window, there is a loop from IM_T_VBRK INTO IM_FS_VBRK where KUNAG = IM_FS_KUNNR
    In main window, i've created a table for displaying item details
    I'm only getting data of Customer in Customer Details window after using driver program. I've checked the entries in the table but for those inputs i'm not getting the desired output..
    Following is the code that i'm using for driver program:
    *& Report  ZPRINTINVOICE2
    REPORT  ZPRINTINVOICE2.
    TABLES:
      kna1,
      vbrk,
      vbrp.
    PARAMETERS :
      p_kunnr LIKE vbrk-kunag,
      p_vbeln LIKE vbrk-vbeln.
    DATA :
      /1BCDWB/SF00000214 TYPE rs38l_fnam.             " Name of the Function Module
    DATA :  t_vbrk LIKE
    STANDARD TABLE
          OF vbrk.
    DATA:  t_vbrp LIKE
    STANDARD TABLE
          OF vbrp.
    DATA :
      fs_kna1 TYPE kna1,                           " Holds Customer Details
      fs_vbrk LIKE LINE OF t_vbrk,         " Holds BillingDoc Header Details
      fs_vbrp LIKE LINE OF t_vbrp.         " Holds BillingDoc Item Details
    START-OF-SELECTION.
      SELECT SINGLE *
               FROM kna1
               INTO fs_kna1
              WHERE kunnr EQ p_kunnr.
       SELECT *
        FROM vbrk
        INTO TABLE t_vbrk
       WHERE kunag EQ p_kunnr
         AND vbeln EQ p_vbeln.
       SELECT *
        FROM vbrp
        INTO TABLE t_vbrp
         FOR ALL ENTRIES IN t_vbrk
       WHERE vbeln = t_vbrk-vbeln.
       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                   = 'ZTRYINVOICE2'
        IMPORTING
          fm_name                    = /1BCDWB/SF00000214
        EXCEPTIONS
          no_form                     = 1
          no_function_module = 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.
       CALL FUNCTION /1BCDWB/SF00000214
        EXPORTING
          im_fs_kna1       = fs_kna1
          im_t_vbrk        = t_vbrk
          im_t_vbrp        = t_vbrp
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    plz help......

    Hi Neha,
    Modify your CALL FUNCTION /1BCDWB/SF00000214 like below :
    CALL FUNCTION /1BCDWB/SF00000214
        EXPORTING
          im_fs_kna1       =  im_fs_kna1
        TABLES
          im_t_vbrk        = im_t_vbrk
          im_t_vbrp        = im_t_vbrp 
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
      IF sy-subrc  0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    At Smarforms > Form Interface > Import :
    im_fs_kna1.
    At Smarforms > Form Interface > Tables :
    im_t_vbrk , im_t_vbrp
    BR
    Dep

  • FI drilldown reports- cant get Line item details in dynamic selection

    Hi,
    In FI drill down reports line item analysis, i create form in FDI4.I get document currency as a key figure.
    While executing a report in tcode FDI0. i gave company code,dealer and currency as 'EUR' in dynamic selection,.
    the correct output value '1245678.98' also displaying ,but i am not able to get line item details for the value '1245678.98'.
    the path to get line items is Extras-->Line items.
    it shows message as 'The value for characteristic Currency is not unique. Reposition the cursor'.
    how to display line item details.
    plz help.

    Hi,
    You can get this functionality with Virtual Key figures.
    You will have the complete dataset in the RSR00002 Enhancement in CMOD.
    Thank you
    Arun

  • Bapi or Function module for getting Bom Item Details (Urgent)

    Hi All,
    I Want to get the Bom Item Details Corresponding to Production Order Number.
    So Please Provide me Some Function Module or Bapi So that by giving the
    Production Order number I will get all material related to that PO.
    Thanks In Advance.

    Hi,
    use the function module.
        call function 'CS_BOM_EXPL_MAT_V2'
          exporting
            capid                 = 'STD1'
            datuv                 = sy-datum
            mktls                 = 'X'
            mehrs                 = 'X'
            mmory                 = '1'
            mtnrv                 =  matnr
            werks                 = werks
          tables
            stb                   = it_stb2
            matcat                = it_matcat
          exceptions
            alt_not_found         = 1
            call_invalid          = 2
            material_not_found    = 3
            missing_authorization = 4
            no_bom_found          = 5
            no_plant_data         = 6
            no_suitable_bom_found = 7
            others                = 8.
    Regards,
    Sankar.

  • Item Details - Event for 'Create', 'Close' buttons - possible?

    Hi Friends,
    I am looking for EPCF Events for Item Details iView. I am able to show the record in this iview by selectIdHandler. Now, i want to clear the iView content - the functionality when we click 'Close' button.
    So, does any one of you know any Events to fire Create, Close buttons on Item Details iView?
    Thanks,
    Raags

    Hello Raags,
    Have you discovered how to trigger any of those events? I'm having a similar issue.
    I need when I open the record to have it in Edit mode already, not to click the Edit button in order to get there.
    Let me know if you discovered a solution.
    Best regards,
    Boris

  • Report to get Asset Line item details & user id details

    HI All,
    Is there any report to get Asset No, Assets line item details & user Id details.
    Thanks in advance.
    Ava

    Hi,
    which user ID? User created? User last changed?
    You can enhance any standard report with individual fields, see WIKI entry [Include additional fields in Standard Fixed Asset ALV reports|https://wiki.sdn.sap.com/wiki/display/ERPFI/IncludeownfieldsinFI-AAstandardALV] and/or SAP note 335065.
    User who created the asset is field ANLAV-ERNAM.
    Regards,
    Markus

  • BAPI to get the Sales order line item details

    Hi,
    My program gets Sale sorder and item as the input and I need to fetch all the item (Given item) details for this Sales Order from VBAP. Is there any BAPI to get the item details?

    Hi,
    This is a sample code of BAPI.Try to map it to your requirement.This is not related to vendor.This is related to sales order.
    Constants
    CONSTANTS: c_contract LIKE vbak-vbeln VALUE '0020000720',
    c_item LIKE vbap-posnr VALUE '000010'.
    Structures
    Structure to hold BAPI Header
    DATA: st_bapisdhd1 LIKE bapisdhd1.
    Internal Tables
    Sales Order Create BAPI Return Messages
    DATA: tbl_return TYPE STANDARD TABLE OF bapiret2
    WITH HEADER LINE.
    Sales Order BAPI Line Item
    DATA: tbl_bapisditm TYPE STANDARD TABLE OF bapisditm
    WITH HEADER LINE.
    Sales Order BAPI Line Item
    DATA: tbl_bapisditmx TYPE STANDARD TABLE OF bapisditmx
    WITH HEADER LINE.
    Sales Order BAPI Pricing Conditions
    DATA: tbl_bapicond TYPE STANDARD TABLE OF bapicond
    WITH HEADER LINE.
    Sales Order BAPI Partner Functions
    DATA: tbl_bapiparnr TYPE STANDARD TABLE OF bapiparnr
    WITH HEADER LINE.
    Sales Order BAPI Schedule Lines
    DATA: tbl_bapischdl TYPE STANDARD TABLE OF bapischdl
    WITH HEADER LINE.
    Sales Order BAPI Schedule Lines
    DATA: tbl_bapischdlx TYPE STANDARD TABLE OF bapischdlx
    WITH HEADER LINE.
    Sales Order BAPI Pricing Conditions
    DATA: tbl_bapicondx TYPE STANDARD TABLE OF bapicondx
    WITH HEADER LINE.
    Customer Enhancement for VBAK, VBAP, VBEP
    DATA: tbl_bapiparex TYPE STANDARD TABLE OF bapiparex
    WITH HEADER LINE.
    Table to hold BAPI Detail Conditions
    DATA: tbl_bapisdcond TYPE STANDARD TABLE OF bapisdcond
    WITH HEADER LINE.
    Table to hold Return Messages from Sales Order Change BAPI
    DATA: tbl_return_chg TYPE STANDARD TABLE OF bapiret2
    WITH HEADER LINE.
    Variables
    DATA: g_vbeln_created LIKE vbak-vbeln,
    g_valid_contract TYPE c,
    g_cont_price_date TYPE d.
    Start of Selection
    START-OF-SELECTION.
    PERFORM validate_contract.
    PERFORM create_sales_ord.
    PERFORM update_sales_ord.
    End of Selection
    END-OF-SELECTION.
    PERFORM write_output_report.
    Subroutines
    *& Form create_sales_ord
    Create the Sales Order
    FORM create_sales_ord .
    PERFORM populate_bapi_tables.
    PERFORM call_create_sales_ord_bapi.
    ENDFORM. " create_sales_ord
    *& Form populate_bapi_tables
    Fill up the BAPI Tables
    FORM populate_bapi_tables .
    PERFORM populate_bapi_header.
    PERFORM build_bapi_partners.
    PERFORM build_bapi_items.
    PERFORM build_bapi_sched_lines.
    ENDFORM. " populate_bapi_tables
    *& Form populate_bapi_header
    Build BAPI Header Details
    FORM populate_bapi_header .
    CLEAR st_bapisdhd1.
    st_bapisdhd1-doc_type = 'ZOC'. "Order type
    st_bapisdhd1-sales_org = '026'. "Sales Org
    st_bapisdhd1-distr_chan = '00'. "Dist Channel
    st_bapisdhd1-division = '00'. "Division
    st_bapisdhd1-purch_no_c = 'Cust Po No'. "Cust PO No
    st_bapisdhd1-name = 'Orderer'. "Name of Orderer
    st_bapisdhd1-ord_reason = ''. "Order Reason
    st_bapisdhd1-sales_off = '3001'. "Sales Office
    st_bapisdhd1-sales_grp = '301'. "Market Area
    IF g_valid_contract = 'X'.
    st_bapisdhd1-price_date = g_cont_price_date.
    ENDIF.
    ENDFORM. " populate_bapi_header
    *& Form build_bapi_partners
    Build BAPI Partner Functions
    FORM build_bapi_partners .
    CLEAR tbl_bapiparnr.
    tbl_bapiparnr-partn_role = 'AG'.
    tbl_bapiparnr-partn_numb = '0000100750'.
    APPEND tbl_bapiparnr.
    CLEAR tbl_bapiparnr.
    tbl_bapiparnr-partn_role = 'WE'.
    tbl_bapiparnr-partn_numb = '0000504472'.
    APPEND tbl_bapiparnr.
    ENDFORM. " build_bapi_partners
    *& Form build_bapi_items
    Build The BAPI Line Items
    FORM build_bapi_items .
    DATA: l_matnr LIKE mara-matnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = '10000072'
    IMPORTING
    output = l_matnr.
    CLEAR tbl_bapisditm.
    tbl_bapisditm-itm_number = c_item.
    IF g_valid_contract = 'X'.
    tbl_bapisditm-ref_doc = c_contract.
    tbl_bapisditm-ref_doc_it = c_item.
    tbl_bapisditm-ref_doc_ca = 'G'. "Contract
    ENDIF.
    tbl_bapisditm-material = l_matnr.
    tbl_bapisditm-plant = '3012'.
    tbl_bapisditm-target_qty = '5.000'.
    tbl_bapisditm-target_qu = 'M3'.
    tbl_bapisditm-item_categ = 'ZZOC'.
    tbl_bapisditm-sales_dist = '301'.
    tbl_bapisditm-dlv_prio = '02'.
    tbl_bapisditm-prc_group5 = '080'.
    tbl_bapisditm-cust_mat35 = 'kdmat'.
    tbl_bapisditm-route = 'TESYS'.
    tbl_bapisditm-usage_ind = 'CIV'.
    APPEND tbl_bapisditm.
    CLEAR tbl_bapisditmx.
    tbl_bapisditmx-itm_number = c_item.
    tbl_bapisditmx-ref_doc = 'X'.
    tbl_bapisditmx-ref_doc_it = 'X'.
    tbl_bapisditmx-ref_doc_ca = 'X'.
    tbl_bapisditmx-material = 'X'.
    tbl_bapisditmx-updateflag = 'I'.
    tbl_bapisditmx-plant = 'X'.
    tbl_bapisditmx-target_qty = 'X'.
    tbl_bapisditmx-target_qu = 'X'.
    tbl_bapisditmx-item_categ = 'X'.
    tbl_bapisditmx-sales_dist = 'X'.
    tbl_bapisditmx-dlv_prio = 'X'.
    tbl_bapisditmx-prc_group5 = 'X'.
    tbl_bapisditmx-cust_mat35 = 'X'.
    tbl_bapisditmx-usage_ind = 'X'.
    tbl_bapisditmx-route = 'X'.
    APPEND tbl_bapisditmx.
    ENDFORM. " build_bapi_items
    *& Form build_bapi_sched_lines
    Build the BAPI Schedule Lines
    FORM build_bapi_sched_lines .
    CLEAR tbl_bapischdl.
    tbl_bapischdl-itm_number = c_item.
    tbl_bapischdl-req_qty = '1'.
    tbl_bapischdl-req_date = sy-datum.
    APPEND tbl_bapischdl.
    ENDFORM. " build_bapi_sched_lines
    *& Form build_bapi_conditions
    Pull the BAPI Pricing Conditions from the Contract
    FORM build_bapi_conditions .
    LOOP AT tbl_bapisdcond.
    CLEAR tbl_bapicond.
    MOVE-CORRESPONDING tbl_bapisdcond TO tbl_bapicond.
    APPEND tbl_bapicond.
    CLEAR tbl_bapicondx.
    tbl_bapicondx-itm_number = tbl_bapicond-itm_number.
    tbl_bapicondx-cond_st_no = tbl_bapicond-cond_st_no.
    tbl_bapicondx-cond_count = tbl_bapicond-cond_count.
    tbl_bapicondx-cond_type = tbl_bapicond-cond_type.
    tbl_bapicondx-updateflag = 'I'.
    tbl_bapicondx-cond_value = 'X'.
    tbl_bapicondx-currency = 'X'.
    tbl_bapicondx-cond_unit = 'X'.
    tbl_bapicondx-cond_p_unt = 'X'.
    tbl_bapicondx-varcond = tbl_bapicond-varcond.
    APPEND tbl_bapicondx.
    ENDLOOP.
    ENDFORM. " build_bapi_conditions
    *& Form call_create_sales_ord_bapi
    Call the Sales Order Create BAPI
    FORM call_create_sales_ord_bapi .
    CLEAR g_vbeln_created.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    order_header_in = st_bapisdhd1
    IMPORTING
    salesdocument = g_vbeln_created
    TABLES
    return = tbl_return
    order_items_in = tbl_bapisditm
    order_items_inx = tbl_bapisditmx
    order_partners = tbl_bapiparnr
    order_schedules_in = tbl_bapischdl.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ENDFORM. " call_create_sales_ord_bapi
    *& Form update_sales_ord
    Update the newly created Sales Order with the Pricing Conditions
    from the Contract
    FORM update_sales_ord .
    CHECK g_valid_contract EQ 'X'.
    PERFORM get_contract_details.
    PERFORM build_bapi_conditions.
    PERFORM call_change_sales_ord_bapi.
    ENDFORM. " update_sales_ord
    *& Form get_contract_details
    Get Contract Details
    FORM get_contract_details .
    Need to manually get the relevant Pricing Conditions as the BAPI
    BAPISDORDER_GETDETAILEDLIST causes problems when we call the BAPI
    BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE (I think
    this is due to the fact that these BAPIs belong to the same Function
    Group and there must be some common structures that are not cleared
    causing us all sorts of grief when we try and call the next BAPI)
    DATA: tbl_konv TYPE STANDARD TABLE OF konv WITH HEADER LINE.
    DATA: tbl_komv TYPE STANDARD TABLE OF komv WITH HEADER LINE.
    DATA: tbl_vbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
    Pricing Condition Master
    DATA: BEGIN OF tbl_t685a OCCURS 0,
    kschl LIKE t685a-kschl,
    kaend_wrt LIKE t685a-kaend_wrt,
    END OF tbl_t685a.
    SELECT *
    INTO TABLE tbl_vbak
    FROM vbak
    WHERE vbeln = c_contract.
    READ TABLE tbl_vbak INDEX 1.
    SELECT *
    INTO TABLE tbl_konv
    FROM konv
    WHERE knumv = tbl_vbak-knumv AND
    kposn = c_item.
    CHECK sy-subrc EQ 0.
    We now need to make sure we only bring across the Condition Types that
    are EDITABLE. If we bring across non editable conditions (such as
    'ZPR1') the Change Sales Order BAPI will fail
    SELECT kschl kaend_wrt
    INTO TABLE tbl_t685a
    FROM t685a
    FOR ALL ENTRIES IN tbl_konv
    WHERE kappl EQ 'V' AND "Sales
    kschl EQ tbl_konv-kschl AND
    kaend_wrt EQ 'X' AND "Value is Editable
    kmanu NE 'D'. "Process manually
    Prepare for Binary Search
    SORT tbl_t685a BY kschl.
    LOOP AT tbl_konv.
    READ TABLE tbl_t685a WITH KEY kschl = tbl_konv-kschl BINARY SEARCH.
    IF sy-subrc EQ 0.
    MOVE-CORRESPONDING tbl_konv TO tbl_komv.
    APPEND tbl_komv.
    ENDIF.
    ENDLOOP.
    CHECK NOT tbl_komv[] IS INITIAL.
    Map KOMV into the more BAPI friendly BAPISDCOND structure
    CALL FUNCTION 'MAP_INT_TO_EXT_STRUCTURE'
    TABLES
    fxvbak = tbl_vbak
    fxkomv = tbl_komv
    fxbapikomv = tbl_bapisdcond
    EXCEPTIONS
    entry_missing = 1
    OTHERS = 2.
    ENDFORM. " get_contract_details
    *& Form call_change_sales_ord_bapi
    Call the Change Sales Order BAPI
    FORM call_change_sales_ord_bapi .
    DATA: st_head_chg LIKE bapisdh1x,
    st_logic_switch TYPE bapisdls.
    CHECK NOT g_vbeln_created IS INITIAL.
    CHECK g_valid_contract EQ 'X'.
    st_head_chg-updateflag = 'U'.
    st_logic_switch-cond_handl = 'X'.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = g_vbeln_created
    order_header_inx = st_head_chg
    logic_switch = st_logic_switch
    TABLES
    return = tbl_return_chg
    conditions_in = tbl_bapicond
    conditions_inx = tbl_bapicondx.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ENDFORM. " call_change_sales_ord_bapi
    *& Form write_output_report
    Produce Output Report
    FORM write_output_report .
    IF NOT g_vbeln_created IS INITIAL.
    WRITE:/ 'Success! Sales Order', g_vbeln_created, 'was created!'.
    ELSE.
    WRITE:/ 'Failure! Sales Order was not created!'.
    ENDIF.
    SKIP.
    WRITE:/ 'Sales Order Create Log'.
    LOOP AT tbl_return.
    WRITE:/ tbl_return-type, tbl_return-id, tbl_return-number,
    tbl_return-message.
    ENDLOOP.
    SKIP.
    WRITE:/ 'Sales Order Change Log'.
    LOOP AT tbl_return_chg.
    WRITE:/ tbl_return_chg-type, tbl_return_chg-id,
    tbl_return_chg-number, tbl_return_chg-message.
    ENDLOOP.
    ENDFORM. " write_output_report
    *& Form validate_contract
    Make sure that the Contract is Valid
    FORM validate_contract .
    DATA: l_gueen LIKE vbak-gueen,
    l_prsdt LIKE vbkd-prsdt.
    SELECT SINGLE vbakgueen vbkdprsdt
    INTO (l_gueen, l_prsdt)
    FROM vbak
    INNER JOIN vbkd
    ON vbakvbeln = vbkdvbeln
    WHERE vbak~vbeln = c_contract AND
    vbkd~posnr = '000000'.
    IF sy-datum LE l_gueen.
    Contract is valid! Set Order Price Date
    g_valid_contract = 'X'.
    g_cont_price_date = l_prsdt.
    ENDIF.
    ENDFORM. " validate_contract
    Regards
    Rajesh Kumar

  • Getting po item details

    i want to extract po item details using BAPI function module.but im not getting data into the int.table 'I_POITEM'.please correct the program and send me some links to learn BAPI.
    DATA : BEGIN OF I_POITEM OCCURS 0.
    INCLUDE STRUCTURE BAPIEKpo.
    DATA : END OF I_POITEM.
    PARAMETERS P_EBELN LIKE EKKO-EBELN.
    CALL FUNCTION 'BAPI_PO_GETDETAIL'
      EXPORTING
        PURCHASEORDER                    = p_ebeln
      ITEMS                            = 'X'
      ACCOUNT_ASSIGNMENT               = ' '
      SCHEDULES                        = ' '
      HISTORY                          = ' '
      ITEM_TEXTS                       = ' '
      HEADER_TEXTS                     = ' '
      SERVICES                         = ' '
      CONFIRMATIONS                    = ' '
      SERVICE_TEXTS                    = ' '
      EXTENSIONS                       = ' '
    IMPORTING
      PO_HEADER                        =
      PO_ADDRESS                       =
    TABLES
      PO_HEADER_TEXTS                  =
       PO_ITEMS                         =   I_POITEM
      PO_ITEM_ACCOUNT_ASSIGNMENT       =
      PO_ITEM_SCHEDULES                =
      PO_ITEM_CONFIRMATIONS            =
      PO_ITEM_TEXTS                    =
      PO_ITEM_HISTORY                  =
      PO_ITEM_HISTORY_TOTALS           =
      PO_ITEM_LIMITS                   =
      PO_ITEM_CONTRACT_LIMITS          =
      PO_ITEM_SERVICES                 =
      PO_ITEM_SRV_ACCASS_VALUES        =
      RETURN                           =
      PO_SERVICES_TEXTS                =
      EXTENSIONOUT                     =
       loop at i_poitem.
       endloop.

    Hello Srinivas
    Evaluate the result of TABLES parameter RETURN. There may be different problems (wrong PO number, no authority, etc.) which will be returned as the corresponding messages.
    Please note that if you use the BAPI within a report you have to take care that the PO number is properly formatted (conversion exits, leading zeros).
    Regards,
      Uwe

  • How to get work item details programatically ?

    Hi All,
    I have a list of work items (process instances) and I want to retrieve each item details such as: attachments, notes, id, ...
    All the items are filtered and represented as Fuego.Papi.Instance:
    Fuego.Papi.Instance[] inst = busProcess.getInstancesByFilter(filter : instFilter);
    But the work item details are inherited from Fuego.Lib.ProcessInstance. So, how to get the item details from inst[] ?
    Would appreciate any help, may be Dan will have an advise ?
    Regards,
    Kim

    If you have instances returned by your filter, you could extract variable information for each instance by doing something like this:
    for each inst in getInstancesByFilter(ps, filter : instF) do
        // here's how to get the value inside a primitive instance variable
        orderAmtObj as Object = getVar(inst, var : "orderAmount")
        // here's how to get the value of attributes inside a complex BPM Object instance variable
        //    - in this case this is an "order" object with two attributes (customerName and amount)
        orderObj as Object = (getVar(inst, var : "order"))
        xmlObject = Fuego.Xml.XMLObject(createXmlTextFor(DynamicXml, object : orderObj, topLevelTag : "xsi"))
        logMessage "The value of the order object's customer name is: " +
               selectString(xmlObject, xpath : "customerName")
        logMessage "The value of the order object's order amount is: " +
               selectNumber(xmlObject, xpath : "amount")
        // here's a rather uninspired way to retrieve who the participant is that was assigned the instance
        logMessage "The participant assigned to this instance is: " + inst.participantId
    endInside the above "for" loop, you could retrieve these predefined variables (this example assumes you use "inst" in your "for" loop):
        objRet as Any
        objRet = inst.getVar(var : "PREDEFINE_ACTIVITY")
        logMessage "Activity name = " + objRet using severity = DEBUGSubstitute "PREDEFINE_ACTIVITY" in the above logic to get this information:
    PREDEFINE_PRIORITY (priority)
    PREDEFINE_ACTIVITY_DEADLINE (activity.deadline)
    PREDEFINE_CREATION_TIME (creation.time)
    PREDEFINE_PROCESS_DEADLINE (deadline)
    PREDEFINE_DESCRIPTION (description)
    PREDEFINE_PROCESS (process)
    PREDEFINE_RECEIVED_TIME (receptionTime)
    PREDEFINE_PARTICIPANT (participant)
    PREDEFINE_COPY (id.copy)
    PREDEFINE_STATUS (status)
    Similarly, you might want to try to get instance information using the Fuego.Papi.VarDefinition object a try. Never used it, but the logic might be as simple as:
        logMessage "who created? = " + inst.getVar(Fuego.Papi.VarDefinition.CREATOR_ID) using severity = DEBUG
        logMessage "does it have attachments? = " + inst.getVar(Fuego.Papi.VarDefinition.HAS_ATTACHMENTS) using severity = DEBUG   
        logMessage "does it have notes? = " + inst.getVar(Fuego.Papi.VarDefinition.hasnotes) using severity = DEBUGDan

  • We need to buy Adobe Framemaker version 11. The distributor is only able to provide us with version 12. Can someone suggest me how is it possible to get the license for ver 11 serial  key after purchasing ver 12 and also how to get the download details ?

    We need to buy Adobe Framemaker version 11. The distributor is only able to provide us with version 12. Can someone suggest me how is it possible to get the license for ver 11 serial  key after purchasing ver 12 and also how to get the download details ?   Urgent response will be helpful.D

    Adobe Support helped us with a similar query. We ended up with exactly what you need.

Maybe you are looking for

  • Web design company looking for iPad app to display my portfolio at a trade show

    I run a small web development business and have my first trade show coming up. I'll have a booth setup and was hoping to have my iPad out on the table for people to pick up and scroll through my portoflio (ie web designs, logo concepts, etc.). I've s

  • When opening Firefox, over 10 windows open, all of which have only a single "New Tab"

    I am running Firefox 5.0. Just recently, it started to open multiple (over 10) windows when I start it from the quick start area. All of the windows open with a single tab entitled "New Tab". Any tabs that I had open from my last Firefox session are

  • Report execution -cash flow

    Hi all Whenever i am trying to execute a cash flow report it goes to form screen and when i click the form it display the form it does not proceed further i am not aware what is happening. I am interested in getting the cash flow  by direct method. P

  • Import ServerBatch not able to connect to server

    I am trying to use import server batch to update some customer master recprds. I am using xml schema  and an xml file with data.  These are succesfully processed through import manager. I tried import server using the same and hit a bug in MDM import

  • How to format 3110 Classic

    reapected Dicussion online, iam shibin form riyadh KSA, i hav a nokia 3110 classic mobile phone. i got a problem now that i forgot my lock code...! i tried my level best to format it too due to the the problem occured to my cell phone. plz if sombody