How to populate internal table( varaible of ABAP table type) in Excel VBA?

Hi,
I am trying to update a database table from excel using a VBA Macro.
I am able to connect to SAP and able to read data from SAP using a RFC. Similarly after updating certain values, i want to update a table in SAP.
Below are the steps I am doing  apart from basic settings.
Getting the reference of the SAP TABLE type from RFC fucntion module
' Call RFC
Set MyFunc = R3.Add("UPDATE_TVARVC_VIA_RFC")
' Get reference and Values TVARVC
Set oParam4 = MyFunc.Tables("TVARVC")   
   2. Loop over the active cells and populate oParam4
          " add values as below
    oParam4.Rows.Add
    oParam4.Value(1, "NAME") = ..................
    oParam4.Value(1, "TYPE") = ..................
    oParam4.Value(1, "NUMB") = ..................
  Do it for all columns in the table line.
My query is how to identify active cells and make the above code dynamic in step 2.
Thanks in Advance,
Best,
Aneel

Hi Aneel,
You can try the following:
e.g.
for j = 1 to ActiveCell.SpecialCells(11).Column
  oParam4.Rows.Add
  if j=1 then oParam4.Value(j, "NAME") = ActiveSheet.Cells(1,j).Value
  if j=2 then oParam4.Value(j, "TYPE")  = ActiveSheet.Cells(1,j).Value
  if j=3 then oParam4.Value(j, "NUMB") = ActiveSheet.Cells(1,j).Value
next j
Regards,
ScriptMan

Similar Messages

  • How to Populate Internal table data to Table Control in a Report Program

    Dear All,
           How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
    Thanks in Advance,
    Joseph Reddy

    If you want to use a table control, you will need to create a screen.
    In your report....
    start-of-selection.
    perform get_data.  " Get all your data here
    call screen 100. " Now present to the user.
    Double click on the "100" in your call screen statement.  This will forward navigate you to the screen.  If you have not created it yet, it will ask you if you want to create it, say yes.  Go into screen painter or layout of the screen.  Use the table control wizard to help you along the process.  It will write the code for you.  Since it is an output only table control, it will be really easy with not a lot of code. 
    A better way to present the data to the user would be to give it in a ALV grid.  If you want to go that way, it is a lot easier.  Here is a sample of the ALV function module.  You don't even have to create a screen.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    endform.
    Regards,
    Rich Heilman

  • How to populate internal table field with text data?

    Hello Experts,
    I was able to load text file to a internal table but data is not populating each field. Can someone help me how to populate each field of internal table from text file?
    Here is the text file:
    io_name, io_type, io_txsht, io_txlng, io_datatype, io_length
    ZEA_IO1, CHA, IO Test,     IO Test 1, CHAR,       20
    ZEA_IO2, CHA, IO Test,     IO Test 2, CHAR,       20
    Here is the Code:
    *& Report  ZAS_BAPI_TEST                                               *
    *& InfoObject Creation through BAPI.
    *& Read the Text file, call a BAPI to create InfoObjects.              *
    *& Text file will hold the Info Object Structure. Text file will be    *
    *& located either work station or local PC.
    *& Step 1. Create internal table to hold InfoObject structure          *
    *& Step 2. Retrieve/Load text file into Internal Table structure       *
    *& Step 3. Call BAPI Function to Create IO                             *
    *& Step 4. Call BAPI Function to Activate IO                           *
    REPORT  ZAS_BAPI_TEST                           .
    Make data separator a comma
    CONSTANTS: gc_tab TYPE c VALUE ','.
          Declaring Internal table for creating InfoObject
    DATA: p_file TYPE string.
    DATA: BEGIN OF itab-bapi OCCURS 0,
            io_name like BAPI6108-infoobject,
            io_type like BAPI6108-type,
            io_txsht like BAPI6108-textshort,
            io_txlng like BAPI6108-textlong,
            io_datatype like BAPI6108-datatp,
            io_length like BAPI6108-intlen,
          END OF itab-bapi.
    DATA ibapi LIKE STANDARD TABLE OF itab-bapi.
    PARAMETERS: sel_file(1500) TYPE c default ' ' OBLIGATORY LOWER CASE.
          PUT THE TEXT FILE PATH TO P_FILE
    p_file = sel_file.
         Copy the file from the workstation to the server        ****
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = p_file
                   FILETYPE                = 'ASC'
                   HAS_FIELD_SEPARATOR     = SPACE
                   HEADER_LENGTH           = 0
                   DAT_MODE                = SPACE
                   CODEPAGE                = SPACE
                   IGNORE_CERR             = ABAP_TRUE
                   REPLACEMENT             = '#'
                   READ_BY_LINE            = 'X'
                 IMPORTING
                   FILELENGTH              =
                   HEADER                  =
      TABLES
        data_tab                = itab-bapi[]
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      MESSAGE e012(zea_spms) WITH 'Method' 'GUI_UPLOAD' sy-subrc.
      &1 &2 issued return code &3
       ELSE.
         pit_data[] = lit_data[].
       ENDIF.
    ENDIF.
    loop at itab-bapi.
      write: /5 itab-bapi-io_name,
               20 itab-bapi-io_type,
               30 itab-bapi-io_txsht,
               50 itab-bapi-io_txlng,
               75 itab-bapi-io_datatype,
               85 itab-bapi-io_length.
    endloop.
          SELECT THE LOCATION FOR TEXT FILE
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ''
          def_path         = 'C:\'
          mask             = ',Documentos de texto (*.txt), *.txt.'
          mode             = ''
        IMPORTING
          filename         = p_file
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      find '.txt' IN p_file.
      if sy-subrc <> 0.
        concatenate p_file '.txt' into sel_file.
      else.
        sel_file = p_file.
      endif.
          Create InfoObject through BAPI Function
    *CALL FUNCTION 'BAPI_IOBJ_CREATE'.
    *IMPORTING
        VALUE(DETAILS) LIKE  BAPI6108 STRUCTURE  BAPI6108
    *EXPORTING
        VALUE(INFOOBJECT) LIKE  BAPI6108-INFOOBJECT
        VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    TABLES
         COMPOUNDS STRUCTURE  BAPI6108CM OPTIONAL
         ATTRIBUTES STRUCTURE  BAPI6108AT OPTIONAL
         NAVIGATIONATTRIBUTES STRUCTURE  BAPI6108AN OPTIONAL
         ATRNAVINFOPROVIDER STRUCTURE  BAPI6108NP OPTIONAL
         HIERARCHYCHARACTERISTICS STRUCTURE  BAPI6108HC OPTIONAL
         ELIMINATION STRUCTURE  BAPI6108IE OPTIONAL
         RETURNTABLE STRUCTURE  BAPIRET2 OPTIONAL
          Activate InfoObject through BAPI Function
    CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
    *ENDFORM.                    " RETRIEVE_DATASET
    I appreciate your help.
    Regards,
    Mau

    I have used tab delimited file.
    Here are file contents
    io_name     io_type     io_txsht     io_txlng     io_datatype     io_length
    ZEA_IO1     CHA     IO Test     IO Test 1     CHAR     20
    ZEA_IO2     CHA     IO Test     IO Test 2     CHAR     20
    And here is program used
    *& Report ZAS_BAPI_TEST *
    *& InfoObject Creation through BAPI.
    *& Read the Text file, call a BAPI to create InfoObjects. *
    *& Text file will hold the Info Object Structure. Text file will be *
    *& located either work station or local PC.
    *& Step 1. Create internal table to hold InfoObject structure *
    *& Step 2. Retrieve/Load text file into Internal Table structure *
    *& Step 3. Call BAPI Function to Create IO *
    *& Step 4. Call BAPI Function to Activate IO *
    REPORT ZAS_BAPI_TEST .
    Make data separator a comma
    CONSTANTS: gc_tab TYPE c VALUE ','.
    Declaring Internal table for creating InfoObject
    DATA: p_file TYPE string.
    DATA: BEGIN OF itab-bapi OCCURS 0,
    io_name like BAPI6108-infoobject,
    io_type like BAPI6108-type,
    io_txsht like BAPI6108-textshort,
    io_txlng like BAPI6108-textlong,
    io_datatype like BAPI6108-datatp,
    io_length like BAPI6108-intlen,
    END OF itab-bapi.
    DATA ibapi LIKE STANDARD TABLE OF itab-bapi.
    PARAMETERS: sel_file(1500) TYPE c default ' ' OBLIGATORY LOWER CASE.
    PUT THE TEXT FILE PATH TO P_FILE
    p_file = sel_file.
    Copy the file from the workstation to the server ****
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = p_file
    <b>FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'</b>
    TABLES
    data_tab = itab-bapi[]
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    not_supported_by_gui = 17
    error_no_gui = 18
    OTHERS = 19.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    MESSAGE e012(zea_spms) WITH 'Method' 'GUI_UPLOAD' sy-subrc.
    &1 &2 issued return code &3
    ELSE.
    pit_data[] = lit_data[].
    ENDIF.
    ENDIF.
    loop at itab-bapi.
    write: /5 itab-bapi-io_name,
    20 itab-bapi-io_type,
    30 itab-bapi-io_txsht,
    50 itab-bapi-io_txlng,
    75 itab-bapi-io_datatype,
    85 itab-bapi-io_length.
    endloop.
    SELECT THE LOCATION FOR TEXT FILE
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    def_filename = ''
    def_path = 'C:\'
    mask = ',Documentos de texto (*.txt), *.txt.'
    mode = ''
    IMPORTING
    filename = p_file
    EXCEPTIONS
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    OTHERS = 5.
    find '.txt' IN p_file.
    if sy-subrc <> 0.
    concatenate p_file '.txt' into sel_file.
    else.
    sel_file = p_file.
    endif.
    Create InfoObject through BAPI Function
    *CALL FUNCTION 'BAPI_IOBJ_CREATE'.
    *IMPORTING
    VALUE(DETAILS) LIKE BAPI6108 STRUCTURE BAPI6108
    *EXPORTING
    VALUE(INFOOBJECT) LIKE BAPI6108-INFOOBJECT
    VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
    TABLES
    COMPOUNDS STRUCTURE BAPI6108CM OPTIONAL
    ATTRIBUTES STRUCTURE BAPI6108AT OPTIONAL
    NAVIGATIONATTRIBUTES STRUCTURE BAPI6108AN OPTIONAL
    ATRNAVINFOPROVIDER STRUCTURE BAPI6108NP OPTIONAL
    HIERARCHYCHARACTERISTICS STRUCTURE BAPI6108HC OPTIONAL
    ELIMINATION STRUCTURE BAPI6108IE OPTIONAL
    RETURNTABLE STRUCTURE BAPIRET2 OPTIONAL
    Activate InfoObject through BAPI Function
    CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
    *ENDFORM. " RETRIEVE_DATASET
    This program is working fine. You can test it.
    Only problem is as the column headings are big for some columns, they are getting truncated which you can always change by changing the column width in declaration
    Please let me know if this helps.
    ashish

  • How to populate the logical_group field in V_LTDX (table for layouts)?

    Hi,
    Scenario:
    I have implemented the ALV using CL_SALV_TABLE. In the grid we have a 'Choose Layout' button where we have the options of choose, change, manage etc. the layouts. If we create a layout, the layout is saved in the table LTDX(view: V_LTDX).
    Issue:
    How do we populate the 'Logical_group' field in the table while creating/changing the layouts?
    Please suggest..
    Regards
    s@k

    Solved..:)
    Solution:
    While creating the ALV grid, use the method 'get_layout' of the class CL_SALV_TABLE and get the reference of the layout in a reference variable.
    Data:
          gw_key       TYPE            salv_s_layout_key.
      gr_layout = gr_grid->get_layout( ).
      gw_key-report = sy-cprog.
      gw_key-logical_group = gc_log_grp." Pass the logical group here say logical group: 0001, 0002, etc. for each ALV
    So, whenever you create/ change a layout on the ALV grid, the system automatically passes this logical group and saves it in the table LTDX.
    Regards
    s@k

  • How to populate the organization_code column in ST table for legacy system

    Hi, dear all,
    Now I use the stage table to load the setup&transaction collection data from a non-EBS legacy system to ASCP system.
    My question is: how to populate the organization_code column in the stage table?If the source system is EBS system, maybe it's an inventory organization code. But for the non-EBS system, which value is need fo this field? keep it as blank? or assign some value for it?
    Thanks
    Edited by: 852938 on 2011-5-4 下午10:24

    I find some words in the implementation guide, it says:"To collect data from your non-Oracle ERP systems or your trading partners' systems,you model each non-Oracle ERP system or trading partner as an Oracle Applications organization and store their setup and transaction data there".
    But I can't find where to model the application organization for the legacy system.
    anyone can give some clues? Thanks in advance.

  • How to populate columns in IVIEW using ABAP FM ?

    Hi All,
    I need to populate columns in IVIEW using ABAP FM. I had developed a FM which is working fine in SAP ABAP. Now Functional people has done the configuration for this FM to MSS.
    When we go to the IVIEW in MSS, My FM is not getting triggered in the MSS portal, it is not displaying any values in that particular column of IVIEW. I dont know why.
    Can anybody help me out? If u need any more details i'll provide that..

    Hi,
    If you need only two why to fetch three ?
    Just doing it by yourself will show you what will happen.
    Regards
    Yoonas

  • How to populate values in to dropdown in table ui element

    Hi,
    according to my scenario  i have atable with five records ...andi have acolumn name DATE and  it contains 5 dropdowns with some values i.e dates from jan 1 2008-dec 31 2008.user needs to select only those values which are in dropdown. can u tell me the code to populate values in to dropdown in table UI element.
    Thanks
    Raju

    Hi,
    you can go for two drop downs like DropDown by Key or Drop Down by Index as per requirment.
    Create context Node for the table UI, in that one will be for ur drop down. Create element for the Context node and add thses to the conetxt.
    Code example for DropDownBy Key:-
    ISimpleType simpleType =               wdContext     .nodeProjEstiTable().getNodeInfo()
         .getAttribute("projphasname")               .getModifiableSimpleType();
    IModifiableSimpleValueSet svs1 =
    simpleType.getSVServices().getModifiableSimpleValueSet();
    svs1.clear();
    for (int j = 0; j < projphasname.length; j++) {
         svs1.put(projphasname[j][1], projphasname[j][1]);
    for DropDownBy Index you can work in normal way means try to create element for the respective context attribute.
    Hope this may help you...
    Deepak

  • How to biod Crystal Reports based on ABAP Tables/Views

    Hi,
      Can any one post me some document stuff on building Crystal reports based on ABAP Tables/Views please!
    Thanks,
    Madhu.

    Hi,
    Check out the links below for Crystal Reports :
    Re: Crystal report in SAP BW
    http://support.businessobjects.com/documentation/product_guides/
    http://help.sap.com/saphelp_nw04/helpdata/en/86/06a8d3be17fc47aa8d850e50cf5f24/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/46/dfd33b1ed4b47de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/34/c0523e83464644e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5f72b7c0e943d99f4f5cef2bfacfe1/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/06/00a63b60f26e3be10000000a114084/frameset.htm
    Hope this helps.
    Cheers,
    Kedar

  • How to get Data from SAP B1 through Journal Entries objects (Excel VBA)

    Hi Genius
    i had try to login SAB B1 thorugh MS Excel VBA code and it worked well. but i need some questions regards getting the data from after login. that means i want the Posting date, Transaction No, account code, debit and credit amount from Journal entries posted in a particular day through MS excel VBA into excel sheets 1 cell A1:E1
    how i get it if any possible ways to do that
    here my code to login
    Public Sub login()
        Sheets("Login").Select  'access the login tab
        Worksheets("Login").Range("B1").Activate 'put focus on cell B1 (manager)
        B1UserID = Trim(ActiveCell.Value2) 'set Businsss One user
        ActiveCell.Offset(1, 0).Activate
        B1Password = Trim(ActiveCell.Value2) 'set Business One password
        ActiveCell.Offset(1, 0).Activate
        sqluser = Trim(ActiveCell.Value2) 'set SQL user
        ActiveCell.Offset(1, 0).Activate
        sqlpass = Trim(ActiveCell.Value2) 'set SQL password
        ActiveCell.Offset(1, 0).Activate
        Db = Trim(ActiveCell.Value2)      'set Database name
        ActiveCell.Offset(1, 0).Activate
        Server = Trim(ActiveCell.Value2)  'set Server name
        Set company1 = New SAPbobsCOM.Company  'initialate DI company object
        company1.DbServerType = dst_MSSQL2005
        company1.Server = Server
        company1.DbUserName = sqluser
        company1.DbPassword = sqlpass
        company1.CompanyDB = Db
        company1.UserName = B1UserID
        company1.Password = B1Password
        'connect to the database
         lRetCode = company1.Connect
            If lRetCode <> 0 Then
                sErrMsg = company1.GetLastErrorDescription
                MsgBox (sErrMsg)
            Else
                MsgBox ("Connected to: " & company1.CompanyName)
            End If
    End Sub
    pls help me
    advance thanks to solvers

    Gordons way is the easiest - just query the OJDT table for journal entry headers and JDT1 for journal entry lines if needed.
    But if you want to work with the business objects:
    'Journal entry
       Dim oJE As SAPbobsCOM.JournalEntries
       Set oJE = company1.GetBusinessObject(oJournalEntries)
       oJE.GetByKey(1234)
       Dim postingDate as String
       postingDate = oJE.DueDate
    'etc etc

  • How to delete formula from cells and keep the values in Excel VBA

    Hi,
    In my Excel I have 15 columns. In column F which has a formula (INDEX MATCH), it has contains "RECEIVED" and "INTRANSIT". I need to filter the column F for all "RECEIVED" and then remove the formula from cells and
    retain or keep the values that are already in the cells. something tricky and i'm not sure on how to work on this in Excel VBA.
    Below is my initla VBA code:
    I already have the codes on how to filter. kindly please help me on how to do this. thank you in advance.
    Sub test_Click()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim rng As Range
    Dim lrow As Long
    Set wb = ThisWorkbook
    Set ws = wb.Sheets("Intransit_")
    Application.ScreenUpdating = False
    ws.AutoFilterMode = False
    With ws
    lrow = .Range("F" & Rows.Count).End(xlUp).Row
    Set rng = .Range("A1:R" & lrow)
    Debug.Print rng.Address
    rng.AutoFilter Field:=6, Criteria1:="RECEIVED"
    End With
    Application.creenUpdting = True
    End Sub

    Solved.
    Sub test_Click()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim rng As Range
    Dim lrow As Long
    Dim rRec As Range
    Dim btField As Byte
    Set wb = ThisWorkbook
    Set ws = wb.Sheets("Intransit_")
    btField = 6
    Application.ScreenUpdating = False
    ws.AutoFilterMode = False
    With ws
    lrow = .Range("F" & Rows.Count).End(xlUp).Row
    Set rng = .Range("A1:R" & lrow)
    With rng
    .AutoFilter Field:=btField, Criteria1:="RECEIVED"
    On Error Resume Next
    Set rRec = .SpecialCells(xlCellTypeVisible)
    On Error GoTo 0
    End With
    .AutoFilterMode = False
    If Not rRec Is Nothing Then
    With rRec
    .Columns(btField).Value = .Columns(6).Value
    End With
    End If
    End With
    Application.ScreenUpdating = True
    End Sub

  • How to populate internal table................

    hii all,
    my code is according this..................
    the three KEY field which is commom in IT_CDPOS & IT_CDHDR  are 
    1. objectclass = 'VBERCGH'
    2. tabname    = 'VBAP'
    3.changind    = 'U'.
    loop at it_cdpos into wa_cdpos.
    z_var = wa_cdpos-tabkey.
    wa_cdhdr-vbeln  =  z_var+3(10).
    wa_cdhdr-posnr  = z_var+13(6).
    modify it_cdhdr from wa_cdhdr transporting vbeln posnr.
    endloop.
    now the problem is that when i execute the code DUMP is come due to modify statement.
    apart from that if i use in place of MODIFY......
    APPEND.
    Data will move but not in proper position.like it appends from the last position.
    As IT_CDHDR has data before this code.
    so according the data that IT_CDHDR contain i want to move vbeln and posnr value in IT_CDHDR at correct position.
    Please provide me the suitable code for that......
    thanks
    Babbal.

    Hi,
    data l_idx type sy-tabix.
    loop at it_cdpos into wa_cdpos.
    *Read table it_cdhdr into wa_cdhdr with key objectclass = wa_cdpos-objectclass*
                                                                  * tabname = wa_cdpos-tabname*
                                                                   *changind = wa_cdpos-changind*
    if sy-subrc = 0.
    *l_idx = sy-tabix.*
    z_var = wa_cdpos-tabkey.
    wa_cdhdr-vbeln = z_var+3(10).
    wa_cdhdr-posnr = z_var+13(6).
    modify it_cdhdr from wa_cdhdr transporting vbeln posnr *index l_idx.*
    clear l_idx.
    endif.
    endloop.
    Edited by: Kamesh Bathla on Aug 14, 2008 4:24 PM

  • How to populate customer specific field data in table /SAPAPO/ORDFLDS

    Dear Gurus,
    I have explained in detail about the problem we face. I guess persons who has implemented enhancement:  /SAPAPO/RRP_IO_COL in their system can help me out.
    Background:
    Purchase requisitions in APO is created by an idoc that comes from a legacy system using BAPI CALL FUNCTION 'BAPI_POSRVAPS_SAVEMULTI3'.
    Business Requirement:
    I have a business requirement where I need to populate an additional data 'Original delivery date' from the idoc during PR creation in Product view.
    Development:
    To achieve the above requirement, we are following the below procedure in our development system.
    1. We are using enhancement:  /SAPAPO/RRP_IO_COL, method: RRP_USEX_COLS_FILL_01 and RRP_USEX_COLS_GET_TEXT_01 to display an additional field 'Original delivery date' in /sapapo/rrp3 - elements view. This field is restricted to Purchase requisition (Order category: AG) only. We are planning to populate the additional data 'Original delivery date' in this customer specific field and store it in table: /SAPAPO/ORDFLDS at the time of PR creation.
    2. Table: /SAPAPO/ORDFLDS is appended with the 'customer specific field'.
    3. We couldnt find a document on how the data can be populated in table /SAPAPO/ORDFLDS.
    4. How to polulate the live cache data in the table  '/APAPO/ORDFLDS' ? ( i.e using connection parameter )?
    Appreciate if you can throw me some light on this.
    Thanks
    Vignesh M

    Hi Vignesh,
    ANy luck on this ? I am trying the almost same thing...and stuck at same point.
    Please let us know if you have any more information.

  • How to populate the master column in a table

    Hi Experts,
    I am trying to implement a hierarchy structure in a table. For that I have inserted a master column of TreeByNestingTableColumn type. The value which are getting displayed in a table are hard coded by me, but I am not able to understand how should I populate the values so that when the table initially appears, it should contain some data (which I hard code) and when I click the master column, it should expand and display value according the master column selected(which I again hard code).
    Please help me in achieving it.
    Regards
    Arjun

    Hi,
    Go throgh the tutorial "Creating a Tree Structure in a Table" in the blow link.
    Web Dynpro Java Tutorials and Samples NW 2004 [original link is broken]
    In these example only the souce of data changes as per your requriement. In the examples they are reading data from java class.
    1. First you need to create a value node with (Parent Id, Boolean Type: isLeaf, Expanded, ChildernLoaded), attributes.
    2. Then you have to create one recursive node under that Value node by selecting that node as reference.
    3. As given in the example create one method called addChildern(Node, ParentId).
    4. Now in the wdDoInit method call this method by passing the Value node and "ROOT" as parent Ids
    5. In addChildern method if parentId is ''ROOT" then populate all the root elements in the parent node.
    6. Now root elements will be populated.
    7. When user clicks on any of the root element then invoke the action loadChildern(this should be binded to Master column) and pass recursive node of that parent element and the parenId (as given in the exmaple).
    8. Based on this parentId now populate the chids in addChildern method.
    See this thread: Helpful:
    Re: Tree implementation in webdynpro project
    Regards,
    Charan
    Regards,
    Charan

  • How to Populate a Dropdown field for a table control with different keys

    Hi All,
    I have Table control with abt eight columns (fields). Out of these eight field one field is with dropdown list. In table control Project ID is Primary key column. Depending upon this Project ID value, i have different values which is to be populated in dropdown boxes. In table control if there is only one project ID value say 'P000715' i can populate it but when i have more than one project ID (P000715, p000716, P000717.....) in display in rows of table control i want to have different values in my dropdown field corresponding to that row of project id. Experts please tell me how to achieve this functionality.
    Thankx in Advance
    Rizwan Ahmad Siddiqui

    The only way you may be able to do this is using
    MODULE PROCESS ON VALUE-REQUEST. User-programmer F4 help
    in your PAI routine.
    In this routine you would build the list and get the returned value to update the field.
    Something like this.
      DATA: BEGIN OF value_tab OCCURS 0,
        field1 TYPE zlmltype,
        field2 TYPE zltypex,
      END OF value_tab.
    * Drop down values
      REFRESH it_return_tab. CLEAR it_return_tab.
      REFRESH value_tab. CLEAR value_tab.
      SELECT ltype ltypex
        INTO TABLE value_tab
        FROM zlmltyp
        WHERE auth NE '9'.    "System Only
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield   = 'FIELD1'
                value_org  = 'S'
           TABLES
                value_tab  = value_tab[]
                return_tab = it_return_tab.
      READ TABLE it_return_tab INDEX 1 INTO wa_return_tab.
      CHECK sy-subrc EQ 0.
      p_pleadtyp = wa_return_tab-fieldval.

  • How to load .csv file into an abap table

    Hi,
    Pls provide me with a sample code on how to load a .csv file (with column header and rows of data) into a table in sap.
    Thank you!
    Moderator Message: A google search would yield faster results, so search!
    Edited by: Suhas Saha on Jan 16, 2012 5:30 PM

    Hi,
    Using GUI_upload convert file to internal table data.
    Using the below statement separate header and data from CSV.
    Read t_itab into wa_titab index 1.
    delete t_itab from wa_itab.
    Create an internal table with the structure same as 'CSV' file and use the below statement to separate.
    loop at t_itab into wa_itab.
          split wa_itab-rec at ',' into var1 var2 var3.
          wa_output-v1 = var1.
          wa_output-v2 = var2.
          wa_output-v3 = var3.
        append wa_output to t_output.
    endloop.
    Edited by: syamsundr on Jan 16, 2012 11:54 AM

Maybe you are looking for

  • Error while applying patch 6890831

    Hi, I have installed 11.1.0.6 Database on my windows server 2003. Now trying to upgrade it to 11.1.0.7. Before apllying the patch, I have stopped all the services, but in the middle getting the following error Error in writing to file c:\11.1.0\db_1\

  • Safari cookies options no longer exist in preferences

    Since updating to Safari 5.1 I cannot access certain websites, receiving message "cookies disabled".  Went to Safari > Preferences> Security, to find there are not any cookie options available.

  • Why is the download/upload speed so slow on my MBA (about 5 times slower than my PC)?

    Why is the download/upload speed so slow on my MBA (about 5 times slower than my PC)?

  • Using more than one phone number on single iPhone for iMessage?

    Is it possible to intentionally have more than one phone number listed under Settings > Messages > Send & Receive?  I know I've heard of 'glitches' where more than one phone number is shown accidentally and how that is solved (signing out of iMessage

  • ABAP Coding issue

    Hi Abapers, I am new to ABAP, I am in the process of learning. I want to do IF KNVK-PAFKT = Z1 select single smtp_addr FROM adr6 INTO v_smtp_addr                           WHERE ADDRNUMBER =   v_adrnr. Endif. But i am able to get the EMail without IF