UNLOCKING single row in ALV using Funtions

hai,
Actually i am displaying a table in ALV USING FUNCTIONS and i am locking key values.
Now my reqment is , if i press (NEW, COPY )button then i have to add one new row and that row should be Unlocked to insert values.
Is it possible USING FUNCTIONS(I have a solution using CLASSES)

Hi ramesh,
it is possible with the LVC FM.i gave the sample yesterday did you check that..
if not check it to day..
REPORT ZTESTALV.
TYPE-POOLS: SLIS.
*- Fieldcatalog
DATA: IT_FIELDCAT  TYPE LVC_T_FCAT,
      IT_FIELDCAT1  TYPE SLIS_T_FIELDCAT_ALV..
*- For Events
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
DATA:  X_FIELDCAT  TYPE LVC_S_FCAT,
        X_FIELDCAT1  TYPE SLIS_FIELDCAT_ALV.
DATA:X_LAYOUT TYPE LVC_S_LAYO.
"{ FOR DISABLE
DATA: LS_EDIT TYPE LVC_S_STYL,
      LT_EDIT TYPE LVC_T_STYL.
"} FOR DISABLE
DATA: BEGIN OF IT_VBAP OCCURS 0,
      VBELN LIKE VBAP-VBELN,
      POSNR LIKE VBAP-POSNR,
      HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
     END OF IT_VBAP.
DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
SELECT VBELN
       POSNR
       UP TO 10 ROWS
      INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
      FROM VBAP.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'VBELN'.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS    = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'POSNR'.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS    = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
"{FOR DISABLE HERE 6ROW IS DISABLED
SY-TABIX = 6.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 10.
INSERT LS_EDIT INTO TABLE LT_EDIT.
LS_EDIT-FIELDNAME = 'POSNR'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 6.
INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB  TRANSPORTING
                                  HANDLE_STYLE .
X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
"} UP TO HERE
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
  EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT_LVC      = X_LAYOUT
    IT_FIELDCAT_LVC    = IT_FIELDCAT
  TABLES
    T_OUTTAB           = IT_VBAP[]
  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.
Regards
vijay

Similar Messages

  • Single row in alv report

    Hi experts...
    I want single row in alv report.
    I have use loop for fatch data into internal table using loop when i am passing data in alv report then the data comes according loop. i want onlu one data in alv row.
    how can i do such, plz help me.

    decleare two internal table.
    read table itab into  wa index  1.
    append wa to itab2.
    pass itab2 only one record display.

  • How to display multiple lines of texts in a single rows in ALV

    Hi,
    I have a unique requirement in which i have to display multiple lines if texts for a single rows in ALV Grid. Right now in my output it is coming in single line which is not visible fully because that text is more than 255 character. So i want to display the test by splitting into multiple lines and show it on output. Please suggest some solution for this if this is possible in ALV.
    Thanks,
    Raghav

    Hi Raghavendra,
    Its not possible to display multiple line in one row of an alv, but i think you can acheive it by splitting the whole text into multiple sub-text.
    For example, if your requirement is as below:
    Field #1          Field #2
    1                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(200 characters)
    2                    yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy(220 character)
    then you can break Field#2 value into say 50 character and then populate the internal table with repetative entries of Field#1 and the finally sort it by Field#1 value... as a result of which you output will be somewhat as below:
    Field#1          Field#2
    1                   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    2                   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
                         yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
                         yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
                         yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
                         yyyyyyyyyyyyyyyyyyyy           
    Hope it will help you in meeting your requirement.
    Regards,
    Shradha

  • Want to be able to open tabs in multiple rows, rather than in a single row. I used tab mix plus before, but it says it is not compatible with New tab Homepage. The older version of Firefox allowed this very easily.

    Want to be able to open tabs in multiple rows, rather than in a single row. I used tab mix plus before, but it says it is not compatible with New tab Homepage. The older version of Firefox allowed this very easily.

    Your plugins list shows outdated plugin(s) with known security and stability risks.
    *Java Plug-in 1.5.0_06 for Netscape Navigator (DLL Helper)
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)

  • Select single row in ALV grid

    ABAPer's ,
    Does anyone can guide me to select single row only in ALV grid , without OO.

    Hello,
    I did not get u.
    But check the below code it may help u.
    tables: mara.
    TYPE-POOLS: SLIS.
    data:repid like sy-repid.
    data: itb type mara occurs 0 with header line,
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
    IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
    ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
    selection-screen begin of block b.
    parameters: p_matnr type matnr.
    selection-screen end of block b.
    select * from mara into table itb where matnr = p_matnr.
    SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'HANDLE_USER_COMMAND'
       I_STRUCTURE_NAME               = 'MARA'
       IS_LAYOUT                      = IT_LAYOUT
       IT_FIELDCAT                    = IT_FIELDCAT[]
      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
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itb
    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.
    FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
    SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    CLEAR IT_FIELDCAT[].
    IF RS_SELFIELD-FIELDNAME = 'MATNR'.
    READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
    WRITE: / ITB1-MAKTX.
    ENDIF.
    ENDCASE.
    ENDFORM. "HANDLE_USER_COMMAND
    Regards

  • How to unlock a row if i use FOR UPDATE clause

    In procedure if we use FOR UPDATE clause, it will lock particular row and allow only one client to update whereas other client can only fetch data in the same row at that time.
    My question is when will it unlock the row, what should we do to unlock the row while writing procedure. Take this example here im using FOR UPDATE clause for client_count, when ll it unlock that particular row in this procedure.
    create or replace PROCEDURE newprocedur(inMerid IN VARCHAR2,outCount OUT NUMBER) AS
    CURSOR c1 IS
    select CLIENT_COUNT from OP_TMER_CONF_PARENT where MER_ID = inMerid FOR UPDATE OF CLIENT_COUNT;
    BEGIN
    Open c1;
    loop
    fetch c1 into outCount;
    exit when c1%NOTFOUND;
    outCount:=outCount+1;
    update OP_TMER_CONF_PARENT set CLIENT_COUNT = outCount where current of c1;
    end loop;
    close c1;
    END;

    Hi,
    Basically you are incrementing client_count by 1 , Why you have to fetch row one by one and update? you could just finish that in a single update
    UPDATE OP_TMER_CONF_PARENT
    SET CLIENT_COUNT = CLIENT_COUNT+1
    WHERE MER_ID     = inMerid This will increment client_count of all rows by one for the given mer_id;
    After updating you have to make the changes permanent so that other users will see the changes you have made.
    To lock the row before update you can use same select statement in you cursor
    SELECT CLIENT_COUNT
    FROM OP_TMER_CONF_PARENT
    WHERE MER_ID = inMerid FOR UPDATE OF CLIENT_COUNT;You can further modify the procedure to let other users know if the row is being updated.
    Regards
    Yoonas

  • Unlock a row in alv - make fields editable

    Hello,
    I have to solve the following problem: I am using ALV FM and I have to display a non-writable alv. When a user selects a line and clicks a button, this line must change to editable mode. I found the example below. At first glance, it seemed to be what I had looked for. But on the second glance I figured out, that it does the opposite of what I need.
    When I set "FIELDCAT-EDIT = space." and "LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED." the whole table rests in locked mode. Could someone please tell me, how to lock all rows and set a single row editable?
    Thanks in advance
    REPORT ZTESTALV.
    TYPE-POOLS: SLIS.
    *- Fieldcatalog
    DATA: IT_FIELDCAT  TYPE LVC_T_FCAT,
          IT_FIELDCAT1  TYPE SLIS_T_FIELDCAT_ALV.
    *- For Events
    DATA:IT_EVENTS TYPE SLIS_T_EVENT.
    DATA:  X_FIELDCAT  TYPE LVC_S_FCAT,
            X_FIELDCAT1  TYPE SLIS_FIELDCAT_ALV.
    DATA:X_LAYOUT TYPE LVC_S_LAYO.
    "{ FOR DISABLE
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    "} FOR DISABLE
    DATA: BEGIN OF IT_VBAP OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
         END OF IT_VBAP.
    DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
    SELECT VBELN
           POSNR
           UP TO 10 ROWS
          INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
          FROM VBAP.
    DATA:L_POS TYPE I VALUE 1.
    CLEAR: L_POS.
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'VBELN'.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '10'.
    x_fieldcat-ref_field = 'VBELN'.
    x_fieldcat-ref_table = 'VBAK'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'POSNR'.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '5'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    <b>"{FOR DISABLE HERE 6ROW IS DISABLED
    SY-TABIX = 6.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = cl_gui_alv_grid=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 10.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'POSNR'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 6.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE .
    X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
    "} UP TO HERE</b>
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
        I_CALLBACK_PROGRAM = SY-REPID
        IS_LAYOUT_LVC      = X_LAYOUT
        IT_FIELDCAT_LVC    = IT_FIELDCAT
      TABLES
        T_OUTTAB           = IT_VBAP[]
      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.
    Message was edited by:
            Achim Beckmann

    The problem is solved.

  • SQL Update a Single Row Multiple Times Using 2 Data Sets

    I'm working in tsql and have an issue where I need to do multiple updates to a single row based on multiple conditions. 
    By Rank_
    If the column is NULL I need it to update no matter what the Rank is.
    If the Ranks are the same I need it to update in order of T2_ID.
    And I need it to use the last updated output.
    I've tried using the update statement below but it only does the first update and the rest are ignored. Here is an example of the data sets i'm working w/ and the Desired results. Thanks in advance!
    update a
    set Middle = case when a.Rank_> b.Rank_ OR a.Middle IS NULL then ISNULL(b.Middle,a.Middle) end,
    LName = case when a.Rank_> b.Rank_ OR a.Lname IS NULL then ISNULL(b.LName,a.LName) end,
    Rank_ = case when a.Rank_> b.Rank_ then b.Rank_ end
    from #temp1 a
    inner join #temp2 b on a.fname = b.fname
    where b.T2_ID in (select top 100% T2_ID from #temp2 order by T2_ID asc)

    The Merge clause actually errors because it attempt to update the same record.  I think this CTE statement is the closest I've come but I'm still working through it as I'm not too familiar w/ them.  It returns multiple rows which I will have to
    insert into a temp table to update since the resulting row I need is the last in the table.
    ;WITH cteRowNumber
    AS(
    Select DISTINCT
    Row_Number() OVER(PARTITION BY a.LName ORDER BY a.LName ASC, a.Rank_ DESC,b.T2ID ASC) AS RowNumber
    ,a.FName
    ,a.LName
    ,b.LName as xLname
    ,a.MName
    ,b.MName AS xMName
    ,a.Rank_
    ,b.Rank_ AS xRank
    ,b.T2ID
    FROM #temp1 a
    inner join #temp2 b
    ON a.fname = b.fname
    ), cteCursor
    AS(
    Select a.RowNumber,
    a.Fname
    ,a.LName
    ,a.xLname
    ,a.MName
    ,a.xMName
    ,a.xRank
    ,a.T2ID
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xRank,a.Rank_) else ISNULL(a.Rank_,a.xRank) end AS Alt_Rank_
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xMName,a.MName) else ISNULL(a.MName,a.xMName) end AS Alt_MName
    ,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xLName,a.lname) else ISNULL(a.LName,a.xlname) end as Alt_Lname
    FROM cteRowNumber a
    where a.RowNumber = 1
    UNION ALL
    Select crt.RowNumber
    ,crt.FName
    ,crt.LName
    ,crt.xLname
    ,crt.MName
    ,crt.xMName
    ,crt.xRank
    ,crt.T2ID
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xRank,Prev.Alt_Rank_) else ISNULL(Prev.Alt_Rank_,crt.xRank) end AS Alt_Rank
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xMName,Prev.Alt_MName) else ISNULL(Prev.Alt_MName,crt.xMName) end AS Alt_MName
    ,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xLName,Prev.Alt_Lname) else ISNULL(Prev.Alt_Lname,crt.xLName) end as Alt_Lname
    FROM cteCursor prev
    inner join cteRowNumber crt
    on prev.fname = crt.fname and prev.RowNumber + 1 = crt.RowNumber
    SELECT cte.*
    FROM cteCursor cte

  • How to store array of data into a single row of  table ,using any of Stmts

    HI Friends,
    Based on my requirements ,i have retrived a set of data from a XXX.jsp page using a request.getParameter() and stored into single dimenssional array . Now i am paassing that array to JAVA class to store a into some table .
    In JSP page users can add text boxes dynamically based on his intrest then those attributes will store in table .it means table attributes are not conatant , it table attributes may change at any time when user adds any textboxs or any fields on JSP page ....thats my module ..
    Now i wanted to store all array of data into Table in a single row .......thats is my requirements .
    How can we use prepareStatement and Statement to store array of results intoo table row ...on each iteration i wanted to store array of results into table atributes ..It means entire array of results should to into table row at time .....coule any one write sytax ,how we do this...
    could any one suggest me stps that i can impliment ......?....please reply ASAP

    Well ..you code can be works for constant number of attributes in table .oopss here my requirement is table attributes not fixed ,we cant put constant number of place holder(? ) in a statement ,because those are not fixed ,
    Let me explain here :
    i am doing in that way only. As i mentioned you Table attributes are not constant .It may very if users add any fields dynamically on JSP page .If users have option to add any text box on Jsp page ,then that attribute will store in table as a attribute .
    Now i amable fetching the all dyamic form data and stored in a Result Array below ...in this iteration all form result data are from jsp page as suggestion form ,it should stored in table in single row on corrsponding attribtes ......next time when users fills FROM ,then those data i am fetching and storing in a Result Array as below and need to store in corrsponding table attributes in a single row ....
    for(int i=0;i<result.length;i++)
                   System.out.println(result);
                   pst3=connection.prepareStatement("insert into *emprecord* values(?)");
                   if(!result[i].equals(""))
                        System.out.println(result[i]);
                             pst3.setString(1,result[i]);
                             pst3.executeUpdate();
    Thnks in advance ....let me know the the way we can store dynamic form data into dyanamic table ...

  • Subtotal Text in Subtotal row  in ALV using LIst dispaly

    Hi pals,
                I am facing problem with subtotal Text in subtotal row in ALV .Please guide me.
    i am sending sample program..
    it is getting terminated.  I am using SAP ECC 6.0  version SAP.
    Thank you.
    Balaji
    REPORT  ztestbdcbk10                            .
    TYPE-POOLS: slis.
    DATA: x_fieldcat TYPE slis_fieldcat_alv,
          it_fieldcat TYPE slis_t_fieldcat_alv,
          l_layout TYPE slis_layout_alv,
          x_events TYPE slis_alv_event,
          it_events TYPE slis_t_event.
    data: lv_string(20) type c.
    DATA: BEGIN OF itab OCCURS 0,
          vbeln LIKE vbak-vbeln,
          posnr LIKE vbap-posnr,
          zmeng LIKE vbap-zmeng,
         END OF itab.
    SELECT
           vbeln
           posnr
           zmeng
           FROM vbap
           UP TO 20 ROWS
           INTO TABLE itab.
    LOOP AT itab.
      itab-zmeng = sy-tabix .
      MODIFY itab INDEX sy-tabix.
    ENDLOOP.
    x_fieldcat-fieldname = 'subtotal'.
    x_fieldcat-outputlen = 10.
    x_fieldcat-col_pos = 0.
    append x_fieldcat to it_fieldcat.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    *x_fieldcat-outputlen = 10.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'ZMENG'.
    x_fieldcat-seltext_l = 'ZMENG'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-do_sum = 'X'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    DATA: sort TYPE slis_sortinfo_alv,
          it_sort TYPE  slis_t_sortinfo_alv.
    sort-fieldname = 'VBELN'.
    sort-spos = 2.
    sort-up = 'X'.
    sort-subtot = 'X'.
    APPEND sort TO it_sort.
    l_layout-totals_text = 'total text'.
    l_layout-subtotals_text = 'Subtotal'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = l_layout
       IT_FIELDCAT                    = it_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       IT_SORT                        = it_sort
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = 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
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       =  itab
    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.

    hi,
    chk this...
    TYPE-POOLS: slis.
    DATA: x_fieldcat TYPE slis_fieldcat_alv,
    it_fieldcat TYPE slis_t_fieldcat_alv,
    l_layout TYPE slis_layout_alv,
    x_events TYPE slis_alv_event,
    it_events TYPE slis_t_event.
    data: lv_string(20) type c.
    DATA: BEGIN OF itab OCCURS 0,
    vbeln LIKE vbak-vbeln,
    posnr LIKE vbap-posnr,
    zmeng LIKE vbap-zmeng,
    END OF itab.
    DATA: sort TYPE slis_sortinfo_alv,
    it_sort TYPE slis_t_sortinfo_alv.
    *x_fieldcat-fieldname = 'subtotal'.
    *x_fieldcat-outputlen = 10.
    *x_fieldcat-col_pos = 0.
    *append x_fieldcat to it_fieldcat.
    *CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'ZMENG'.
    x_fieldcat-seltext_l = 'ZMENG'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-do_sum = 'X'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    refresh it_sort.  clear it_sort.
    sort-fieldname = 'VBELN'.
    sort-spos = 3.
    sort-up = 'X'.
    sort-subtot = 'X'.
    APPEND sort TO it_sort.
    clear sort.
    l_layout-subtotals_text = 'Subtotal'.
    l_layout-totals_text = 'total text'.
    start-of-selection.
    SELECT
    vbeln
    posnr
    zmeng
    FROM vbap
    UP TO 20 ROWS
    INTO TABLE itab.
    end-of-selection.
    sort itab.
    LOOP AT itab.
    itab-zmeng = sy-tabix .
    MODIFY itab INDEX sy-tabix.
    ENDLOOP.
    *data: v_repid type sy-repid.
    *v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             = I_BYPASSING_BUFFER
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               = 'ITAB'
       IS_LAYOUT                      = l_layout
       IT_FIELDCAT                    = IT_FIELDCAT[]
      IT_EXCLUDING                   = IT_EXCLUDING
      IT_SPECIAL_GROUPS              = IT_SPECIAL_GROUPS
       IT_SORT                        = IT_SORT
      IT_FILTER                      = IT_FILTER
      IS_SEL_HIDE                    = IS_SEL_HIDE
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     = IS_VARIANT
      IT_EVENTS                      = IT_EVENTS
      IT_EVENT_EXIT                  = IT_EVENT_EXIT
      IS_PRINT                       = IS_PRINT
      IS_REPREP_ID                   = IS_REPREP_ID
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           = IR_SALV_LIST_ADAPTER
      IT_EXCEPT_QINFO                = IT_EXCEPT_QINFO
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER         = ES_EXIT_CAUSED_BY_USER
      TABLES
        t_outtab                       = itab
    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.
    do reward if it helps,
    priya.

  • Need Multiple rows in a single Row in ALV

    Hi Experts,
    Here is the example which i want to implement. Please suggest the best.
    This is what I have now in ALV.
    ID            Name         ActionType                    ActionDt
    1             aaa            Joining                            01.02.2011
    1             aaa            Seperation                      05.05.2011
    2             bbb            Joining                            01.04.2011         
    2             bbb            Seperation                      25.05.2011
    This is what I need.
    ID      Name         ActionDt              ActionType(Join)           ActionDt             ActionType(Seperation)
    1       aaa            01.02.2011          Joining                          05.05.2011              Seperation
    2       bbb            01.04.2011          Joining                          25.05.2011              Seperation  
    Thanks in Advance,
    Dinesh
    Moderator message : Spec dumping is not allowed, search for available information or show the work you have already done. Thread locked.
    Edited by: Vinod Kumar on Aug 19, 2011 2:06 PM

    Hi,
    Here are the steps how you can do it.
    1. Create a table.
    2. In the Library palette, click the Standard category and drag the Table object into a cell in the main table.
    Note: If you selected Donu2019t Show This Again in the Insert Table dialog box, when you select the Table object from the Library palette, LiveCycle Designer automatically inserts a table with the same number of columns and rows that you inserted the last time you used the Insert Table dialog box.
    3. In the Insert Table dialog box, enter the number of columns and rows. You can enter a maximum of 20 columns and 50 rows. You can add more columns and rows after the table is created by using the Insert commands on the Table menu.
    4. To add a header row, select Include Header Row In Table.
    5. To add a footer row, select the Include Footer Row In Table.
    6. Click OK.
    Regards
    Runal

  • How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display

    Hi experts..
    i got one requirement like i need to edit some rows particularly in alv....
    Edit in alv output....is it possible to get  that .....using normal function module with out using oops concept...
    could any one pls help me...

    Hi Pendurti ,
    If you want a particular field to be editable , simply define the fieldcatalog as
    wa_fieldcatalog-edit          = 'X'.
    wa_fieldcatalog-input         = 'X'.
    for that field.
    and
    Now when you use FM ' Reuse alv grid display '
    define USER_COMMAND
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = v_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = int_fieldcatalog
          is_layout                = wa_layout
        TABLES
          t_outtab                 = t_disp.
    and now in form USER_COMMAND ; code as per following
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                                rs_selfield TYPE slis_selfield.
         DATA ref1 TYPE REF TO cl_gui_alv_grid.
         CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
             e_grid = ref1.
         CALL METHOD ref1->check_changed_data.
    endform.
    Regards,
    Yogendra Bhaskar

  • How to dispaly items of Particular Sorder of IT into single row in alv dis?

    Hi,
    Experts,
    I have an Sales order internal table along with its corresponding items
    i want to display those items in side by side in alv display.
    Ex:
    Vbeln   posnr   netwr    waerk
    56800   10       21.00    Col
    56800   20      
    56800   30      
    56800   40      
    I want to display:
    Vbeln   posnr  posnr2 posnr3 posnr4  netwr    waerk
    56800   10       20        30       40       21.00    Col
    I have added columns how can pull data into particular columns .How can i achieve this if any idea or input or suggestions please far word to me.
    Thank You,
    Shabeer ahmed.

    Hi,
    Using basic report you can do like this:
    DATA: BEGIN OF itab occurs 0,
    sku(10) TYPE c,
    month(2) TYPE n,
    qty(2) TYPE n,
    END OF itab.
    itab-sku = 'AA'.
    itab-month = '01'.
    itab-qty = 10.
    APPEND ITAB.
    itab-sku = 'AA'. itab-month = 02. itab-qty = 20. APPEND ITAB.
    itab-sku = 'AA'. itab-month = 03. itab-qty = 20. APPEND ITAB.
    itab-sku = 'BB'. itab-month = 01. itab-qty = 20. APPEND ITAB.
    itab-sku = 'BB'. itab-month = 02. itab-qty = 40. APPEND ITAB.
    itab-sku = 'CC'. itab-month = 02. itab-qty = 50. APPEND ITAB.
    itab-sku = 'CC'. itab-month = 03. itab-qty = 10. APPEND ITAB.
    itab-sku = 'CC'. itab-month = 04. itab-qty = 20. APPEND ITAB.
    PERFORM LIST.
    FORM LIST.
    data: cl like itab-sku.
    SKIP TO LINE 3.
    LOOP AT ITAB.
    if cl <> itab-sku.
    write : / itab-sku.
    else.
    write : ''.
    endif.
    write : itab-qty.
    cl = itab-sku.
    ENDLOOP.
    ENDFORM.
    Regards,
    Bhaskar

  • Inserting million of Ids in a single row and make use of them in a Query

    Hi ,
    we are using Oracle10g. I need to have a table structure like this,
    User_Holdings     
    User_ID (Number)
    Pattern_Number (Number)
    Holding_List (CLOB ??)
    Eg. Row:
    User_ID Patt_No Holding_List
    01**********101*********** 98675600,87009922,23965565,10076800,…
    02**********96************ 10000011,34564423,22789674,23232232,...
    This table contains unique user_ids as rows.
    Here each user would have list of Holding_Ids(8-digits) those are seperated by comma.
    My problem is, in real time each User will be having around 0.5 to 1.0 million Holding Ids. At that point of time, will this column(Holding_List) able to hold all Holding ids? If yes, which datatype will rightly support that column?
    FYI, in the application I need to display the Holding details pertaining to that User_Id. The proposed sample query will be like this,
         >      select col1, col2, col3,...
              from     Holding
              where      Holding_Id IN (select Holding_List
                        from      User_Holding
                        where      user_id = 01);                    
    Awaiting your earlier reply.
    Thanks.

    SQL> select * from User_Holdings;
        USERID PATTERN_NUMBER HOLDING_LIST
             1            101 98675600 87009922 23965565 10076800
             2             96 10000011 34564423 22789674 23232232
    SQL> create index User_Holdings_tix on User_Holdings (holding_list) indextype is ctxsys.context;         
    Index created.
    SQL> select * from User_Holdings where contains(holding_list,'98675600',1) > 0;
        USERID PATTERN_NUMBER HOLDING_LIST
             1            101 98675600 87009922 23965565 10076800Message was edited by:
    Laurent Schneider
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 2040 | 4 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| USER_HOLDINGS | 1 | 2040 | 4 (0)| 00:00:01 |
    |* 2 | DOMAIN INDEX | USER_HOLDINGS_TIX | | | 4 (0)| 00:00:01 |
    well, it uses an index...
    HTH

  • Color a single cell in ALV using OO

    Dear Gurus ,
    I tried to color a cell using OO in ALV but i can't . I think my code is correct but i can't find the problem ...
    Look my code please ...
    DATA: BEGIN OF ITAB OCCURS 0,
               PERNR    LIKE PTRV_HEAD-PERNR,
               ENAME    LIKE PA0001-ENAME,
               REINR    LIKE PTRV_HEAD-REINR,
               ZORT1    LIKE PTRV_HEAD-ZORT1,
    *           ZLAND    LIKE PTRV_HEAD-ZLAND,
               KUNDE    LIKE PTRV_HEAD-KUNDE,
               DATV1    LIKE PTRV_HEAD-DATV1,
               DATB1    LIKE PTRV_HEAD-DATB1,
               DAYS_DIFF TYPE I,
               EXODAMET LIKE PTRV_SREC-REC_AMOUNT,
               PAGIAMET LIKE PTRV_SREC-REC_AMOUNT,
               DIFFMET TYPE P DECIMALS 2,
               EXODAERG LIKE PTRV_SREC-REC_AMOUNT,
               PAGIAERG LIKE PTRV_SREC-REC_AMOUNT,
               DIFFERG LIKE PTRV_SREC-REC_AMOUNT,
               CELLCOLOR   TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA : ITAB_WA LIKE LINE OF ITAB.
    FORM SET_CELL_COLORS.
      LOOP AT ITAB INTO ITAB_WA.
    *    L_INDEX = SY-TABIX.
        IF ITAB_WA-PERNR = '231034'.
          LS_CELLCOLOR-FNAME = 'DATB1'.
          LS_CELLCOLOR-COLOR-COL = '7'.
          LS_CELLCOLOR-COLOR-INT = '1'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB_WA-CELLCOLOR.
          MODIFY ITAB FROM ITAB_WA TRANSPORTING CELLCOLOR.
        ENDIF.
      ENDLOOP.
    CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
              EXPORTING
    *       I_BUFFER_ACTIVE =
    *       I_CONSISTENCY_CHECK =
    *       I_STRUCTURE_NAME =
              IS_VARIANT = LS_VARI
              I_SAVE = GS_TEST-VARI_SAVE
              I_DEFAULT = 'X'            "GS_TEST-VARI_DEFAULT
              IS_LAYOUT = GS_LAYOUT
    *       IS_PRINT =
    *       IT_SPECIAL_GROUPS =
    *       IT_TOOLBAR_EXCLUDING =
    *       IT_HYPERLINK =
              CHANGING
                IT_OUTTAB = ITAB[]
                IT_FIELDCATALOG = GT_FIELDCAT
                IT_SORT = LT_SORT
    *        IT_FILTER =
              EXCEPTIONS
                INVALID_PARAMETER_COMBINATION = 1
                PROGRAM_ERROR = 2
                TOO_MANY_LINES = 3
                OTHERS = 4 .
          IF SY-SUBRC <> 0.
    *--Exception handling
          ENDIF.
    If i do it w/o OO i can do it ....
    Can you see the problem ....?
    Thanks a lot ...

    hi dimath,
      I think your code is fine jst make sure you have mention in layout this:
        w_layout-ctab_fname = 'CELLCOLOR' .  and name in your ITAB and in layout ie cellcolor should be same.
    Thanks,
    Gaurav

Maybe you are looking for

  • Feature Request : Router to Router VPN support

    I realize this has been highlighted earlier as not being supported currently, but it would be very useful to allow additional subnets into the NM sphere (my assumption would be one Home network and additinal subnets treated as foreign networks).  Any

  • Ejb deploy

    i use derby and sun app server i created application with enterprise bean and web content in it (index.jsp) my index.jsp is supposed to display the data returned by the bean but when i deploy it i get [#|2008-11-11T21:50:22.387+0100|WARNING|sun-appse

  • Cost roll up Process...

    Dear Experts, Please clarify the below issue. Split valuation and Material Ledger is active for my client. During 2010, they have changed price control indicator to Standard for Raw material. One SFG, they have in-house production and external procur

  • SOA Suite 11g OWSM (no Gateway)

    Hi I am currently looking at a new high level design for a SOA implementation using the Oracle SOA Suite 11g. We have a small issue around how to secure our externally facing web services that are exposed out to the WWW. Previously I would have place

  • Printing Hallmark cards without borders on c309 printer

    I have a C309 all in onePhotosmart Premium printer.  I've been making Hallmark Cards for the last 5 or 6 yrs.  I am currently using Hallmark 2012 software.  They always print with a white border, even though I have the setting at Borderless.   Hallma