Skip to Content
0
Former Member
Apr 24, 2007 at 06:02 AM

Quantity field in at user-command

16 Views

Hi,

I have declared the quantity field V_QTY TYPE AFKO-GAMNG.

I am passing the quantity field values from the internal table which is having data for the quantity field to V_QTY. but the field V_QTY is not filling with the quantity.

Instead of the quantity, it is taking the * value into the field.

I am not using any control break commands in my coding. I am attaching the code also. can anyone guide me .

***********************************************************************************

Report ztest.

TABLES: AFKO, " Order Header

AFPO, " Order Item

AUFK, " Order Master

RESB,

AFVC, " Order Operation w/i an Order

AFVV, " Qty/Dates/values in an Operation

CRHD, " Work Center

MARA, " Material Master

MAKT, " Material Description

AUSP, " Characteristic Values

CABN, " Characteristic

PLPO, " Task list-operation/activity

PLFL, " Task list - sequences

TJ02T, " System status texts

JEST. " Individual Object Status

TYPE-POOLS:SLIS.

TYPE-POOLS:ICON.

DATA:CHECK(1),

TOTAL(7) VALUE 'TOTAL :',

W_AMOUNT TYPE GAMNG VALUE 0.

TYPES:BEGIN OF T_AFKO,

CHECK,

AUFNR TYPE AFKO-AUFNR,

GLTRP TYPE AFKO-GLTRP,

GSTRP TYPE AFKO-GSTRP,

GAMNG TYPE AFKO-GAMNG,

PLNBEZ TYPE AFKO-PLNBEZ,

END OF T_AFKO.

DATA:I_AFKO TYPE STANDARD TABLE OF T_AFKO,

W_AFKO LIKE LINE OF I_AFKO.

DATA:I_AFKO1 TYPE STANDARD TABLE OF T_AFKO,

W_AFKO1 LIKE LINE OF I_AFKO1.

DATA:PONUM TYPE AFKO-AUFNR,

STDATE TYPE AFKO-GLTRP,

FIDATE TYPE AFKO-GSTRP,

QUANTY TYPE AFKO-GAMNG,

MATER TYPE AFKO-PLNBEZ,

DESCR TYPE MAKT-MAKTX,

INDEX TYPE SY-INDEX,

COUNT(3) VALUE '0'.

TYPES:BEGIN OF T_FINAL,

CHECK,

LIGHT TYPE ICON-ID,

MATNR TYPE RESB-MATNR,

AUFNR TYPE AFKO-AUFNR,

GLTRP TYPE AFKO-GLTRP,

GSTRP TYPE AFKO-GSTRP,

GAMNG TYPE AFKO-GAMNG,

PLNBEZ TYPE AFKO-PLNBEZ,

MAKTX TYPE MAKT-MAKTX,

END OF T_FINAL.

DATA:I_FINAL TYPE STANDARD TABLE OF T_FINAL,

W_FINAL LIKE LINE OF I_FINAL,

I_FINAL1 TYPE STANDARD TABLE OF T_FINAL,

W_FINAL1 LIKE LINE OF I_FINAL1.

TYPES:BEGIN OF T_CRHD,

OBJID TYPE CRHD-OBJID,

ARBPL TYPE CRHD-ARBPL,

END OF T_CRHD.

DATA:I_CRHD TYPE STANDARD TABLE OF T_CRHD,

W_CRHD LIKE LINE OF I_CRHD.

TYPES:BEGIN OF T_AFVC,

AUFPL TYPE AFVC-AUFPL,

ARBID TYPE AFVC-ARBID,

END OF T_AFVC.

DATA:I_AFVC TYPE STANDARD TABLE OF T_AFVC,

W_AFVC LIKE LINE OF I_AFVC.

TYPES:BEGIN OF T_ITEM,

MATNR TYPE RESB-MATNR, " Component Matl Number

MAKTX TYPE MAKT-MAKTX, " Matl Desc for Component

BDMNG TYPE RESB-BDMNG, " Component Req'd Qty

END OF T_ITEM.

DATA:I_ITEM TYPE STANDARD TABLE OF T_ITEM,

W_ITEM LIKE LINE OF I_ITEM.

TYPES:BEGIN OF T_RESB,

MATNR TYPE RESB-MATNR,

AUFNR TYPE RESB-AUFNR,

BDMNG TYPE RESB-BDMNG,

END OF T_RESB.

DATA:I_RESB TYPE STANDARD TABLE OF T_RESB,

W_RESB LIKE LINE OF I_RESB.

DATA:I_MAKT TYPE STANDARD TABLE OF MAKT,

W_MAKT LIKE LINE OF I_MAKT,

I_MAKT1 TYPE STANDARD TABLE OF MAKT,

W_MAKT1 LIKE LINE OF I_MAKT1.

TYPES:BEGIN OF T_AUFK,

AUFNR TYPE AUFK-AUFNR,

AUART TYPE AUFK-AUART,

WERKS TYPE AUFK-WERKS,

OBJNR TYPE AUFK-OBJNR,

END OF T_AUFK.

DATA:I_JEST TYPE STANDARD TABLE OF JEST,

W_JEST LIKE LINE OF I_JEST.

DATA:I_AUFK TYPE STANDARD TABLE OF T_AUFK,

W_AUFK LIKE LINE OF I_AUFK.

DATA:V_QTY TYPE AFKO-GAMNG,

LINES TYPE I,

V_AUFNR TYPE AFKO-AUFNR.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS:

P_WERKS TYPE AUFK-WERKS OBLIGATORY MEMORY ID WRK, " PLANT

P_AUART TYPE AUFK-AUART OBLIGATORY. "ORDER TYPE

SELECT-OPTIONS: S_PLNBEZ FOR AFKO-PLNBEZ. "material

PARAMETERS: P_ARBPL TYPE CRHD-ARBPL OBLIGATORY. "Work center

SELECT-OPTIONS:

S_GSTRP FOR AFKO-GSTRP OBLIGATORY. "ORDER BASIC START DATE

*s_gltrp FOR afko-gltrp OBLIGATORY, "ORDER BASIC FINISH DATE

*s_gstrs FOR afko-gstrs, "ORDER SCHEDULE START DATE

*s_gltrs FOR afko-gltrs. "ORDER SCHEDULE FINISH DATE

PARAMETERS:P_MATNR TYPE RESB-MATNR.

SELECTION-SCREEN END OF BLOCK B1.

*ALV data declarations

DATA: I_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,

W_FIELDCATALOG LIKE LINE OF I_FIELDCATALOG,

S_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,

GD_LAYOUT TYPE SLIS_LAYOUT_ALV,

GD_REPID LIKE SY-REPID VALUE SY-REPID,

T_HEADING TYPE SLIS_T_LISTHEADER,

IT_LISTHEADER TYPE SLIS_T_LISTHEADER,

W_KEYINFO TYPE SLIS_KEYINFO_ALV,

WA_SORT TYPE SLIS_SORTINFO_ALV,

IT_SORT TYPE SLIS_T_SORTINFO_ALV,

IT_TITLE_BASIC TYPE

LVC_TITLE VALUE 'SELECTION OF PRODUCTION ORDERS',

IT_TITLE_ITEM TYPE LVC_TITLE VALUE 'MIXING REPORT'.

DATA: PO TYPE AUFNR,

P_SELFIELD TYPE SLIS_SELFIELD.

DATA: I_EVENTS TYPE SLIS_T_EVENT,

W_EVENTS LIKE LINE OF I_EVENTS.

CLEAR: W_EVENTS.

REFRESH: I_EVENTS.

DATA:I_HEADER TYPE SLIS_T_LISTHEADER,

W_HEADER LIKE LINE OF I_HEADER.

********************************************************************

  • BEGIN OF CODE FOR ALV_HIERSEQ_LIST*************

********************************************************************

TYPES:BEGIN OF T_HHEADER,

  • EXPAND,

MATNR TYPE RESB-MATNR,

MAKTX TYPE MAKT-MAKTX,

V_QTY,

END OF T_HHEADER.

DATA:I_HHEADER TYPE STANDARD TABLE OF T_HHEADER,

W_HHEADER LIKE LINE OF I_HHEADER.

TYPES:BEGIN OF T_HITEM,

CHECK,

MATNR TYPE RESB-MATNR,

AUFNR TYPE AFKO-AUFNR,

GAMNG TYPE AFKO-GAMNG,

PLNBEZ TYPE AFKO-PLNBEZ,

MAKTX TYPE MAKT-MAKTX,

GLTRP TYPE AFKO-GLTRP,

GSTRP TYPE AFKO-GSTRP,

END OF T_HITEM.

DATA:I_HITEM TYPE STANDARD TABLE OF T_HITEM,

W_HITEM LIKE LINE OF I_HITEM.

***********************************************************************

  • END OF CODE FOR ALV_HIERSEQ_LIST ****************************

**********************************************************************

INITIALIZATION.

PERFORM BUILD_FIELDCATALOG.

PERFORM BUILD_LAYOUT.

*Start-of-selection.

START-OF-SELECTION.

PERFORM GET_EVENTS.

PERFORM GET_DATA.

END-OF-SELECTION.

PERFORM DISPLAY_ALV_REPORT.

&----


*& Form BUILD_FIELDCATALOG

&----


  • text

----


FORM BUILD_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '1'.

W_FIELDCATALOG-FIELDNAME = 'MATNR'.

W_FIELDCATALOG-TABNAME = 'I_HHEADER'.

W_FIELDCATALOG-SELTEXT_M = 'Phantom Material'.

  • W_FIELDCATALOG-ROLLNAME = 'MATNR'.

W_FIELDCATALOG-OUTPUTLEN = '20'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '2'.

W_FIELDCATALOG-FIELDNAME = 'MAKTX'.

W_FIELDCATALOG-TABNAME = 'I_HHEADER'.

W_FIELDCATALOG-SELTEXT_M = 'Phantom Material Description'.

  • W_FIELDCATALOG-ROLLNAME = 'MAKTX'.

W_FIELDCATALOG-OUTPUTLEN = '40'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '3'.

W_FIELDCATALOG-FIELDNAME = 'BDMNG'.

W_FIELDCATALOG-TABNAME = 'I_HHEADER'.

W_FIELDCATALOG-OUTPUTLEN = '20'.

W_FIELDCATALOG-SELTEXT_M = 'Total Batch qty:'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '1'.

W_FIELDCATALOG-SELTEXT_M = 'Selection'.

W_FIELDCATALOG-FIELDNAME = 'CHECK'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

W_FIELDCATALOG-EDIT = 'X'.

W_FIELDCATALOG-CHECKBOX = 'X'.

W_FIELDCATALOG-INPUT = 'X'.

  • W_FIELDCATALOG-HOTSPOT = 'X'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

  • CLEAR W_FIELDCATALOG .

  • W_FIELDCATALOG-COL_POS = '2'.

  • W_FIELDCATALOG-FIELDNAME = 'MATNR'.

  • W_FIELDCATALOG-TABNAME = 'I_HITEM'.

  • W_FIELDCATALOG-ROLLNAME = 'MATNR'.

  • W_FIELDCATALOG-OUTPUTLEN = '12'.

  • APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '2'.

W_FIELDCATALOG-FIELDNAME = 'AUFNR'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

W_FIELDCATALOG-ROLLNAME = 'AUFNR'.

W_FIELDCATALOG-OUTPUTLEN = '12'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG.

W_FIELDCATALOG-COL_POS = '3'.

  • W_FIELDCATALOG-SELTEXT_M = 'PO Qty'.

W_FIELDCATALOG-FIELDNAME = 'GAMNG'.

W_FIELDCATALOG-ROLLNAME = 'GAMNG'.

W_FIELDCATALOG-OUTPUTLEN = '20'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG.

W_FIELDCATALOG-COL_POS = '4'.

  • W_FIELDCATALOG-SELTEXT_M = 'Header Material'.

W_FIELDCATALOG-FIELDNAME = 'PLNBEZ'.

W_FIELDCATALOG-ROLLNAME = 'MATNR'.

W_FIELDCATALOG-OUTPUTLEN = '20'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG.

W_FIELDCATALOG-COL_POS = '5'.

  • W_FIELDCATALOG-SELTEXT_M = 'Material Description'.

W_FIELDCATALOG-FIELDNAME = 'MAKTX'.

W_FIELDCATALOG-ROLLNAME = 'MAKTX'.

W_FIELDCATALOG-OUTPUTLEN = '40'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '6'.

W_FIELDCATALOG-FIELDNAME = 'GSTRP'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

W_FIELDCATALOG-ROLLNAME = 'CO_GSTRP'.

W_FIELDCATALOG-OUTPUTLEN = '10'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

CLEAR W_FIELDCATALOG .

W_FIELDCATALOG-COL_POS = '7'.

W_FIELDCATALOG-FIELDNAME = 'GLTRP'.

W_FIELDCATALOG-TABNAME = 'I_HITEM'.

W_FIELDCATALOG-ROLLNAME = 'CO_GLTRP'.

W_FIELDCATALOG-OUTPUTLEN = '10'.

  • W_FIELDCATALOG-SELTEXT_M = 'Basic End Date'.

APPEND W_FIELDCATALOG TO I_FIELDCATALOG.

ENDFORM. "BUILD_FIELDCATALOG

&----


*& Form get_events

&----


  • text

----


FORM GET_EVENTS.

CLEAR : W_EVENTS, I_EVENTS[].

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = I_EVENTS.

READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE

INTO W_EVENTS.

IF SY-SUBRC EQ 0.

MOVE 'TOP_OF_PAGE' TO W_EVENTS-FORM.

MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.

ENDIF.

READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND

INTO W_EVENTS.

IF SY-SUBRC EQ 0.

MOVE 'SUB_USER_COMMAND' TO W_EVENTS-FORM.

MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.

ENDIF.

READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_PF_STATUS_SET

INTO W_EVENTS.

IF SY-SUBRC EQ 0.

MOVE 'PF_STATUS_SET' TO W_EVENTS-FORM.

MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.

ENDIF.

ENDFORM. "get_events

&----


*& Form build_layout

&----


  • text

----


FORM BUILD_LAYOUT.

  • gd_layout-no_input = 'X'.

  • gd_layout-colwidth_optimize = 'X'.

GD_LAYOUT-ZEBRA = 'X'.

W_KEYINFO-HEADER01 = 'MATNR'.

W_KEYINFO-ITEM01 = 'MATNR'.

GD_LAYOUT-TOTALS_TEXT = 'Totals'(201).

  • GD_LAYOUT-EXPAND_FIELDNAME = 'EXPAND'.

ENDFORM. " BUILD_LAYOUT

&----


*& Form data_retrieval

&----


  • text

----


FORM GET_DATA.

  • IF p_matnr IS NOT INITIAL.

SELECT MATNR

AUFNR

BDMNG

FROM RESB INTO TABLE I_RESB

WHERE DUMPS = 'X'.

  • AND matnr = p_matnr.

SORT I_RESB BY MATNR AUFNR.

  • ENDIF.

SELECT * FROM JEST INTO CORRESPONDING FIELDS OF TABLE I_JEST

WHERE STAT = 'I0002'

AND INACT = ' '.

SELECT OBJID

ARBPL

FROM CRHD INTO TABLE I_CRHD WHERE ARBPL = P_ARBPL.

IF NOT I_CRHD[] IS INITIAL.

SELECT AUFPL

ARBID

FROM AFVC INTO TABLE I_AFVC

FOR ALL ENTRIES IN I_CRHD

WHERE ARBID = I_CRHD-OBJID.

ENDIF.

IF NOT I_AFVC[] IS INITIAL.

SELECT AUFNR

GLTRP

GSTRP

GAMNG

PLNBEZ

FROM AFKO INTO CORRESPONDING FIELDS OF TABLE I_AFKO

FOR ALL ENTRIES IN I_AFVC

WHERE AUFPL = I_AFVC-AUFPL

AND GSTRP IN S_GSTRP.

SORT I_AFKO BY AUFNR.

ENDIF.

IF NOT I_AFKO[] IS INITIAL.

SELECT AUFNR

AUART

WERKS

OBJNR

FROM AUFK INTO TABLE I_AUFK

FOR ALL ENTRIES IN I_AFKO

WHERE AUFNR = I_AFKO-AUFNR

AND AUART = P_AUART

AND WERKS = P_WERKS.

SORT I_AUFK BY AUFNR OBJNR.

SELECT * FROM MAKT INTO TABLE I_MAKT1

FOR ALL ENTRIES IN I_AFKO

WHERE MATNR = I_AFKO-PLNBEZ

AND SPRAS = SY-LANGU.

SORT I_MAKT1 BY MATNR.

ENDIF.

IF NOT I_RESB[] IS INITIAL.

SELECT * FROM MAKT INTO TABLE I_MAKT

FOR ALL ENTRIES IN I_RESB

WHERE MATNR = I_RESB-MATNR

AND SPRAS = SY-LANGU.

SORT I_MAKT BY MATNR.

ENDIF.

  • CLEAR W_HHEADER-BDMNG.

***BEGIN OF PHANTOM MATERIAL HEADER INTERNAL TABLE***

CLEAR W_AUFK.

CLEAR W_RESB.

LOOP AT I_RESB INTO W_RESB.

W_HHEADER-MATNR = W_RESB-MATNR.

READ TABLE I_MAKT INTO W_MAKT

WITH KEY MATNR = W_RESB-MATNR BINARY SEARCH.

W_HHEADER-MAKTX = W_MAKT-MAKTX.

APPEND W_HHEADER TO I_HHEADER.

MODIFY I_HHEADER FROM W_HHEADER INDEX SY-TABIX.

CLEAR W_HHEADER.

CLEAR W_RESB.

SORT I_HHEADER BY MATNR.

DELETE ADJACENT DUPLICATES FROM I_HHEADER.

ENDLOOP.

****END OF PHANTOM MATERIAL HEADER INTERNAL TABLE***

**BEGIN OF PHANTOM MATERIAL ITEM DETAILS***************

IF NOT I_HHEADER[] IS INITIAL.

LOOP AT I_HHEADER INTO W_HHEADER.

LOOP AT I_RESB INTO W_RESB WHERE MATNR = W_HHEADER-MATNR.

IF SY-SUBRC = 0.

READ TABLE I_AUFK INTO W_AUFK

WITH KEY AUFNR = W_RESB-AUFNR.

READ TABLE I_JEST INTO W_JEST

WITH KEY OBJNR = W_AUFK-OBJNR.

IF SY-SUBRC = 0.

W_HITEM-CHECK = CHECK.

W_HITEM-MATNR = W_HHEADER-MATNR.

READ TABLE I_AFKO INTO W_AFKO

WITH KEY AUFNR = W_AUFK-AUFNR BINARY SEARCH.

W_HITEM-AUFNR = W_AFKO-AUFNR.

W_HITEM-PLNBEZ = W_AFKO-PLNBEZ.

READ TABLE I_MAKT1 INTO W_MAKT1

WITH KEY MATNR = W_AFKO-PLNBEZ.

W_HITEM-MAKTX = W_MAKT1-MAKTX.

W_HITEM-GLTRP = W_AFKO-GLTRP.

W_HITEM-GSTRP = W_AFKO-GSTRP.

W_HITEM-GAMNG = W_AFKO-GAMNG.

APPEND W_HITEM TO I_HITEM.

MODIFY I_HITEM FROM W_HITEM INDEX SY-TABIX.

SORT I_HITEM BY AUFNR.

CLEAR W_HITEM.

ENDIF.

ENDIF.

ENDLOOP.

ENDLOOP.

ENDIF.

***********END OF PHANTOM MATERIAL ITEM DETAILS.*********************

ENDFORM. "get_item_DETAILS

&----


*& Form top_of_page

&----


  • text

----


FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = I_HEADER

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM. " alv_top_of_page

&----


*& Form user_command

&----


  • text

----


  • -->P_UCOMM text

  • -->P_SELFIELD text

----


FORM DISPLAY_ALV_REPORT.

SORT I_HHEADER BY MATNR.

SORT I_HITEM BY MATNR AUFNR.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

I_CALLBACK_PROGRAM = GD_REPID

I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'

I_CALLBACK_USER_COMMAND = 'SUB_USER_COMMAND'

IS_LAYOUT = GD_LAYOUT

IT_FIELDCAT = I_FIELDCATALOG

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = I_EVENTS[]

  • IT_EVENT_EXIT =

I_TABNAME_HEADER = 'I_HHEADER'

I_TABNAME_ITEM = 'I_HITEM'

  • i_structure_name_header =

  • i_structure_name_item =

IS_KEYINFO = W_KEYINFO

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB_HEADER = I_HHEADER

T_OUTTAB_ITEM = I_HITEM

  • 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.

ENDFORM. "display_alv_report

*****BEGIN OF CUMMILATIVE QUANTITY***********************

FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.

BREAK POINT.

SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.

ENDFORM. "PF_STATUS_SET

&----


*& Form SUB_USEMR_COMMAND

&----


  • text

----


  • -->P_UCOMM text

  • -->P_SELFIELD text

----


FORM SUB_USER_COMMAND USING P_UCOMM LIKE SY-UCOMM

P_SELFIELD TYPE SLIS_SELFIELD.

CASE SY-UCOMM.

WHEN 'SUMM'.

CLEAR W_HITEM.

CLEAR W_HHEADER-V_QTY.

P_SELFIELD-REFRESH = 'X'.

DATA:LV_TABIX TYPE SY-TABIX.

LOOP AT I_HITEM INTO W_HITEM.

READ TABLE I_HHEADER INTO W_HHEADER

WITH KEY MATNR = W_HITEM-MATNR BINARY SEARCH.

IF SY-SUBRC = 0.

LV_TABIX = SY-TABIX.

IF W_HITEM-CHECK = 'X'.

W_HHEADER-V_QTY = W_HHEADER-V_QTY + W_HITEM-GAMNG.

MODIFY I_HHEADER FROM W_HHEADER

INDEX LV_TABIX." TRANSPORTING V_QTY.

ENDIF.

ENDIF.

ENDLOOP.

ENDCASE.

ENDFORM. "USER_COMMAND

*********END OF CUMMILATIVE QUANTITY

***********************************************************************************

Thanks in advance.

Ramesh.