on 04-24-2009 5:48 AM
Hi,
tis is my query,
{ FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.
DATA : OK_CODE TYPE SY-UCOMM.
OK_CODE = P_UCOMM.
CASE OK_CODE.
WHEN '&IC1'.
IF R_SELFIELD-FIELDNAME = 'MENGE1'.
LOOP AT ITAB WHERE EBELN = ITAB-EBELN
AND EBELP = ITAB-EBELP
AND MENGE = ITAB-MENGE1.
MOVE ITAB-EBELP TO IT_PO-EBELP.
MOVE ITAB-EBELN TO IT_PO-EBELN.
MOVE ITAB-MENGE1 TO IT_PO-MENGE.
APPEND IT_PO.
ENDLOOP.
loop at it_po.
SELECT * FROM EKBE WHERE
EBELN = ITab-EBELN
AND EBELP = ITab-EBELP
MENGE = ITAB-MENGE1.
IT_PO-BWART = EKBE-BWART.
IT_PO-BELNR = EKBE-BELNR.
IT_PO-BUZEI = EKBE-BUZEI.
IT_PO-BUDAT = EKBE-BUDAT.
IT_PO-DMBTR = EKBE-DMBTR.
IT_PO-HSWAE = EKBE-HSWAE.
IT_PO-BPMNG = EKBE-BPMNG.
IT_PO-WRBTR = EKBE-WRBTR.
IT_PO-WAERS = EKBE-WAERS.
IT_PO-XBLNR = EKBE-XBLNR.
ENDSELECT.
APPEND IT_PO.
CLEAR IT_PO.
ENDLOOP.
REFRESH IT_FIELDCAT1[].
S_LAYOUT-ZEBRA = 'X' .
S_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1
USING: 'IT_PO' 'BWART' ' ' 'MVT TYPE' ' ',
'IT_PO' 'BELNR' ' ' ' MAT DOC.NO' ' ',
'IT_PO' 'BUZEI' ' ' 'ITEM' ' ',
'IT_PO' 'BUDAT' ' ' 'POSTING DATE' '',
'IT_PO' 'DMBTR' ' ' 'AMOUNT' ' ',
'IT_PO' 'HSWAE' ' ' 'CURRENCY KEY' ' ',
'IT_PO' 'BPMNG' ' ' 'QTY IN OPUN' ' ',
'IT_PO' 'WRBTR' ' ' 'AMOUNT IN DOC' ' ',
'IT_PO' 'WAERS' ' ' 'CURRENCY KEY' ' ',
'IT_PO' 'XBLNR' ' ' 'REFERENCE DOC.NO' ' '.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMM'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_PO
IF SY-SUBRC <> 0.
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "USER_COMM }
my output in alv grid format.
if i am clicking menge1 it will go to next screen.
when i am going next time the existing data repeated again.it should not repeat and also
i want to give one more field ebeln like menge1.
regards,
k.karthikeyan.
Hi Karthikeyan,
add this statement.-> REFRESH IT_PO[].
before the following context.
WHEN '&IC1'.
IF R_SELFIELD-FIELDNAME = 'MENGE1'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karethikeyan,
check the field catalog..
clear the field catalog when ever you ar building the field catalog..
next check the table which you are passing to ALV FM.
Regards,
Prabhudas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.