Skip to Content
0
Former Member
Sep 21, 2014 at 09:35 AM

How to display ?

19 Views

This is program,

TYPES : BEGIN OF TY_HEAD,

TICK_NO TYPE ZTICK_NO,

FISRT_WT TYPE ZFT_WEIGHT,

F_DATE TYPE ZDATE,

SECOND_WT TYPE ZSC_WEIGHT,

SEC_DATE TYPE ZDATE,

NET_WEIGHT TYPE ZNET_WT,

END OF TY_HEAD.

TYPES : BEGIN OF TY_FINAL,

TICK_NO TYPE ZTICK_NO,

FISRT_WT TYPE ZFT_WEIGHT,

F_DATE TYPE ZDATE,

SECOND_WT TYPE ZSC_WEIGHT,

SEC_DATE TYPE ZDATE,

NET_WEIGHT TYPE ZNET_WT,

SNO TYPE ZWEIGHT_ITEM-SNO,

VENDOR TYPE ZWEIGHT_ITEM-VENDOR,

VENDOR_NAME TYPE ZWEIGHT_ITEM-VENDOR_NAME,

EBELN TYPE ZWEIGHT_ITEM-EBELN,

EBELP TYPE ZWEIGHT_ITEM-EBELP,

MATNR TYPE ZWEIGHT_ITEM-MATNR,

MAKTX TYPE ZWEIGHT_ITEM-MAKTX,

MBLNR TYPE ZWEIGHT_ITEM-MBLNR,

MBLPO TYPE ZWEIGHT_ITEM-MBLPO,

NO_BAGS TYPE ZWEIGHT_ITEM-NO_BAGS,

WT_BAG TYPE ZWEIGHT_ITEM-WT_BAG,

POST_WT TYPE ZWEIGHT_ITEM-POST_WT,

TOTAL_WT TYPE ZWEIGHT_ITEM-TOTAL_WT,

BAG_TYP TYPE ZWEIGHT_ITEM-BAG_TYP,

MAT_UPD TYPE ZWEIGHT_ITEM-MAT_UPD,

LFBNR TYPE ZWEIGHT_ITEM-LFBNR,

LFPOS TYPE ZWEIGHT_ITEM-LFPOS,

END OF TY_FINAL.

TYPES :BEGIN OF TY_NUM,

TICK_NO TYPE CHAR2,

END OF TY_NUM.

DATA : LT_NUM TYPE TABLE OF TY_NUM,

WA_NUM TYPE TY_NUM.

DATA : LT_HEAD TYPE STANDARD TABLE OF TY_HEAD,

WA_HEAD TYPE TY_HEAD,

LT_HEAD1 LIKE LT_HEAD,

LT_ITEM TYPE STANDARD TABLE OF ZWEIGHT_ITEM,

WA_ITEM TYPE ZWEIGHT_ITEM,

LT_FINAL TYPE TABLE OF TY_FINAL,

WA_FINAL TYPE TY_FINAL.

DATA : LT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FLDCAT TYPE SLIS_FIELDCAT_ALV.

DATA : LT_EVENTS TYPE SLIS_T_EVENT,

WA_EVENTS TYPE SLIS_ALV_EVENT.

DATA: LT_SORT TYPE SLIS_T_SORTINFO_ALV,

WA_SORT TYPE SLIS_SORTINFO_ALV.

DATA : LV_NUM TYPE CHAR2.

TABLES:ZWEIGHT_HEADER.

DATA: CNT TYPE I VALUE 1.

DATA: LT_STRUCT TYPE DD02L-TABNAME.

SELECT-OPTIONS : S_TICK FOR ZWEIGHT_HEADER-TICK_NO,

S_DATE FOR ZWEIGHT_HEADER-F_DATE.

PARAMETERS: P_NUM TYPE CHAR2 .

TYPES:

BEGIN OF TY_TICK,

TICK_NO TYPE ZTICK_NO,

END OF TY_TICK,

T_RETURN_TAB TYPE DDSHRETVAL.

DATA:

WA_TICK TYPE TY_TICK,

W_RETURN_TAB TYPE T_RETURN_TAB,

C TYPE C VALUE 'S'.

DATA:

LT_TICK TYPE STANDARD TABLE OF TY_TICK,

I_RETURN_TAB TYPE STANDARD TABLE OF T_RETURN_TAB,

WA_RETURN LIKE LINE OF I_RETURN_TAB.

*&---------------------------------------------------------------------*

*& AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks

*&---------------------------------------------------------------------*

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_TICK-LOW.

PERFORM F4_HELP_FOR_PALANT USING 'S_TICK-LOW'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_TICK-HIGH.

PERFORM F4_HELP_FOR_PALANT USING 'S_TICK-HIGH'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NUM.

PERFORM F4_HELP_FOR_P_NUM.

*&---------------------------------------------------------------------*

*& Form f4_help_for_palant

*&---------------------------------------------------------------------*

FORM F4_HELP_FOR_PALANT USING L_DYNPROFIELD.

SELECT TICK_NO

FROM ZWEIGHT_HEADER

INTO TABLE LT_TICK.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

* DDIC_STRUCTURE = ' '

RETFIELD = 'TICK_NO'

* PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = L_DYNPROFIELD

* STEPL = 0

* WINDOW_TITLE =

* VALUE = ' '

VALUE_ORG = C

* MULTIPLE_CHOICE = ' '

* DISPLAY = ' '

* CALLBACK_PROGRAM = ' '

* CALLBACK_FORM = ' '

* MARK_TAB =

* IMPORTING

* USER_RESET =

TABLES

VALUE_TAB = LT_TICK

* FIELD_TAB =

RETURN_TAB = I_RETURN_TAB

* DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 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.

ENDFORM. "f4_help_for_palant

START-OF-SELECTION.

SELECT TICK_NO

FISRT_WT

F_DATE

SECOND_WT

SEC_DATE

NET_WEIGHT

FROM ZWEIGHT_HEADER INTO TABLE LT_HEAD

WHERE TICK_NO IN S_TICK AND F_DATE IN S_DATE.

IF LT_HEAD IS NOT INITIAL.

SELECT * FROM ZWEIGHT_ITEM INTO TABLE LT_ITEM

FOR ALL ENTRIES IN LT_HEAD WHERE TICK_NO = LT_HEAD-TICK_NO .

ENDIF.

IF P_NUM IS INITIAL.

LOOP AT LT_ITEM INTO WA_ITEM.

READ TABLE LT_HEAD INTO WA_HEAD WITH KEY TICK_NO = WA_ITEM-TICK_NO.

IF SY-SUBRC = 0.

WA_FINAL-TICK_NO = WA_HEAD-TICK_NO.

WA_FINAL-FISRT_WT = WA_HEAD-FISRT_WT.

WA_FINAL-F_DATE = WA_HEAD-F_DATE.

WA_FINAL-SECOND_WT = WA_HEAD-SECOND_WT.

WA_FINAL-SEC_DATE = WA_HEAD-SEC_DATE.

WA_FINAL-NET_WEIGHT = WA_HEAD-NET_WEIGHT.

WA_FINAL-SNO = WA_ITEM-SNO.

WA_FINAL-VENDOR = WA_ITEM-VENDOR.

WA_FINAL-VENDOR_NAME = WA_ITEM-VENDOR_NAME.

WA_FINAL-EBELN = WA_ITEM-EBELN.

WA_FINAL-EBELP = WA_ITEM-EBELP.

WA_FINAL-MATNR = WA_ITEM-MATNR.

WA_FINAL-MAKTX = WA_ITEM-MAKTX.

WA_FINAL-MBLNR = WA_ITEM-MBLNR.

WA_FINAL-MBLPO = WA_ITEM-MBLPO.

WA_FINAL-NO_BAGS = WA_ITEM-NO_BAGS.

WA_FINAL-WT_BAG = WA_ITEM-WT_BAG.

WA_FINAL-POST_WT = WA_ITEM-POST_WT.

WA_FINAL-TOTAL_WT = WA_ITEM-TOTAL_WT.

WA_FINAL-BAG_TYP = WA_ITEM-BAG_TYP.

WA_FINAL-MAT_UPD = WA_ITEM-MAT_UPD.

WA_FINAL-LFBNR = WA_ITEM-LFBNR.

WA_FINAL-LFPOS = WA_ITEM-LFPOS.

APPEND WA_FINAL TO LT_FINAL.

CLEAR WA_FINAL.

ENDIF.

ENDLOOP.

SORT LT_FINAL.

ELSE.

LOOP AT LT_ITEM INTO WA_ITEM.

IF WA_ITEM-TICK_NO+0(2) = P_NUM.

READ TABLE LT_HEAD INTO WA_HEAD WITH KEY TICK_NO = WA_ITEM-TICK_NO.

IF SY-SUBRC EQ 0.

WA_FINAL-TICK_NO = WA_HEAD-TICK_NO.

WA_FINAL-FISRT_WT = WA_HEAD-FISRT_WT.

WA_FINAL-F_DATE = WA_HEAD-F_DATE.

WA_FINAL-SECOND_WT = WA_HEAD-SECOND_WT.

WA_FINAL-SEC_DATE = WA_HEAD-SEC_DATE.

WA_FINAL-NET_WEIGHT = WA_HEAD-NET_WEIGHT.

ENDIF.

WA_FINAL-SNO = WA_ITEM-SNO.

WA_FINAL-VENDOR = WA_ITEM-VENDOR.

WA_FINAL-VENDOR_NAME = WA_ITEM-VENDOR_NAME.

WA_FINAL-EBELN = WA_ITEM-EBELN.

WA_FINAL-EBELP = WA_ITEM-EBELP.

WA_FINAL-MATNR = WA_ITEM-MATNR.

WA_FINAL-MAKTX = WA_ITEM-MAKTX.

WA_FINAL-MBLNR = WA_ITEM-MBLNR.

WA_FINAL-MBLPO = WA_ITEM-MBLPO.

WA_FINAL-NO_BAGS = WA_ITEM-NO_BAGS.

WA_FINAL-WT_BAG = WA_ITEM-WT_BAG.

WA_FINAL-POST_WT = WA_ITEM-POST_WT.

WA_FINAL-TOTAL_WT = WA_ITEM-TOTAL_WT.

WA_FINAL-BAG_TYP = WA_ITEM-BAG_TYP.

WA_FINAL-MAT_UPD = WA_ITEM-MAT_UPD.

WA_FINAL-LFBNR = WA_ITEM-LFBNR.

WA_FINAL-LFPOS = WA_ITEM-LFPOS.

APPEND WA_FINAL TO LT_FINAL.

CLEAR WA_FINAL.

ENDIF.

ENDLOOP.

ENDIF.

WA_FLDCAT-FIELDNAME = 'TICK_NO'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'TICKET NO'.

WA_FLDCAT-SELTEXT_M = 'TICKET NO'.

WA_FLDCAT-SELTEXT_S = 'TICKET NO'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 1.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'FISRT_WT'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'FIRST WEIGHT'.

WA_FLDCAT-SELTEXT_M = 'FIRST WEIGHT'.

WA_FLDCAT-SELTEXT_S = 'FIRST WEIGHT'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 3.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'F_DATE'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'FIRST DADE'.

WA_FLDCAT-SELTEXT_M = 'FIRST DADE'.

WA_FLDCAT-SELTEXT_S = 'FIRST DADE'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 6.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'SECOND_WT'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'SECOND WEIGHT'.

WA_FLDCAT-SELTEXT_M = 'SECOND WEIGHT'.

WA_FLDCAT-SELTEXT_S = 'SECOND WEIGHT'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 4.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'SEC_DATE'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'SECOND DATE'.

WA_FLDCAT-SELTEXT_M = 'SECOND DATE'.

WA_FLDCAT-SELTEXT_S = 'SECOND DATE'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 7.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'NET_WEIGHT'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_HEADER'.

WA_FLDCAT-SELTEXT_L = 'NET_WEIGHT'.

WA_FLDCAT-SELTEXT_M = 'NET_WEIGHT'.

WA_FLDCAT-SELTEXT_S = 'NET_WEIGHT'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 5.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'SNO'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'SERIAL NUMBER'.

WA_FLDCAT-SELTEXT_M = 'SNO'.

WA_FLDCAT-SELTEXT_S = 'SNO'.

WA_FLDCAT-OUTPUTLEN = 5.

WA_FLDCAT-COL_POS = 2.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'VENDOR'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'ACCOUNT NUMBER'.

WA_FLDCAT-SELTEXT_M = 'ACCOUNT NUMBER'.

WA_FLDCAT-SELTEXT_S = 'ACCOUNT NUMBER'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 8.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'VENDOR_NAME'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'VENDOR NAME'.

WA_FLDCAT-SELTEXT_M = 'VENDOR NAME'.

WA_FLDCAT-SELTEXT_S = 'VENDOR NAME'.

WA_FLDCAT-OUTPUTLEN = 40.

WA_FLDCAT-COL_POS = 9.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'EBELN'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'PURCHASING DOCUMENT NUMBER'.

WA_FLDCAT-SELTEXT_M = 'PURCHASING DOCUMENT NO'.

WA_FLDCAT-SELTEXT_S = 'PURCHASE DOC.NO'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 10.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'EBELP'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Item Number of Purchasing Document'.

WA_FLDCAT-SELTEXT_M = 'ITEM NUMBER OF PURCHASE DOC'.

WA_FLDCAT-SELTEXT_S = 'ITEM NO'.

WA_FLDCAT-OUTPUTLEN = 10.

WA_FLDCAT-COL_POS = 11.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'MATNR'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'MATERIAL NUMBER'.

WA_FLDCAT-SELTEXT_M = 'MATERIAL NO'.

WA_FLDCAT-SELTEXT_S = 'MATERIAL NO'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 12.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'MAKTX'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Material Description'.

WA_FLDCAT-SELTEXT_M = 'Material Desc'.

WA_FLDCAT-SELTEXT_S = 'Mat Desc'.

WA_FLDCAT-OUTPUTLEN = 40.

WA_FLDCAT-COL_POS = 13.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'MBLNR'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Number of Material Document'.

WA_FLDCAT-SELTEXT_M = 'NO of Material Doc'.

WA_FLDCAT-SELTEXT_S = 'NO of Mat Doc'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 14.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'MBLPO'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Item in Material Document'.

WA_FLDCAT-SELTEXT_M = 'Item in Material Document'.

WA_FLDCAT-SELTEXT_S = 'Item in MATERIAL Doc'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 15.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'NO_BAGS'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'No.of Bags'.

WA_FLDCAT-SELTEXT_M = 'No.of Bags'.

WA_FLDCAT-SELTEXT_S = 'No.of Bags'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 16.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'WT_BAG'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Weight Per Bag'.

WA_FLDCAT-SELTEXT_M = 'Weight Per Bag'.

WA_FLDCAT-SELTEXT_S = 'Weight Per Bag'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 17.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'POST_WT'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Post Weight'.

WA_FLDCAT-SELTEXT_M = 'Post Weight'.

WA_FLDCAT-SELTEXT_S = 'Post Weight'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 18.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'TOTAL_WT'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Total Weight'.

WA_FLDCAT-SELTEXT_M = 'Total Weight'.

WA_FLDCAT-SELTEXT_S = 'Total Weight'.

WA_FLDCAT-OUTPUTLEN = 15.

WA_FLDCAT-COL_POS = 19.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'BAG_TYP'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Bag Type'.

WA_FLDCAT-SELTEXT_M = 'Bag Type'.

WA_FLDCAT-SELTEXT_S = 'Bag Type'.

WA_FLDCAT-OUTPUTLEN = 10.

WA_FLDCAT-COL_POS = 20.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'MAT_UPD'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'status of Material Document'.

WA_FLDCAT-SELTEXT_M = 'status of Material Doc'.

WA_FLDCAT-SELTEXT_S = 'status of Mat Doc'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 21.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'LFBNR'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Document No. of a Reference Document'.

WA_FLDCAT-SELTEXT_M = 'Doc No.of a Reference Doc'.

WA_FLDCAT-SELTEXT_S = 'Doc No.of a Reference Doc'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 22.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

WA_FLDCAT-FIELDNAME = 'LFPOS'.

WA_FLDCAT-TABNAME = 'ZWEIGHT_ITEM'.

WA_FLDCAT-SELTEXT_L = 'Item of a Reference Document'.

WA_FLDCAT-SELTEXT_M = 'Item of a Reference Doc'.

WA_FLDCAT-SELTEXT_S = 'Item of a Reference Doc'.

WA_FLDCAT-OUTPUTLEN = 20.

WA_FLDCAT-COL_POS = 23.

APPEND WA_FLDCAT TO LT_FLDCAT.

CLEAR WA_FLDCAT.

END-OF-SELECTION.

WA_SORT-FIELDNAME = 'TICK_NO'.

APPEND WA_SORT TO LT_SORT.

CLEAR WA_SORT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

* I_INTERFACE_CHECK = ' '

* I_BYPASSING_BUFFER = ' '

* I_BUFFER_ACTIVE = 'X'

I_CALLBACK_PROGRAM = SY-REPID

* I_CALLBACK_PF_STATUS_SET = ' '

* I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = ''

* I_CALLBACK_HTML_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = LT_STRUCT

* I_BACKGROUND_ID = ' '

* I_GRID_TITLE =

* I_GRID_SETTINGS =

* IS_LAYOUT =

IT_FIELDCAT = LT_FLDCAT

* IT_EXCLUDING =

* IT_SPECIAL_GROUPS =

IT_SORT = LT_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 = LT_FINAL

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

* Implement suitable error handling here

ENDIF.

*&---------------------------------------------------------------------*

*& Form F4_HELP_FOR_P_NUM

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

FORM F4_HELP_FOR_P_NUM .

SELECT TICK_NO

FISRT_WT

F_DATE

SECOND_WT

SEC_DATE

NET_WEIGHT

FROM ZWEIGHT_HEADER INTO TABLE LT_HEAD1

WHERE TICK_NO IN S_TICK AND F_DATE IN S_DATE .

LOOP AT LT_HEAD1 INTO WA_HEAD.

LV_NUM = WA_HEAD-TICK_NO+0(2).

WA_NUM-TICK_NO = LV_NUM.

APPEND WA_NUM TO LT_NUM.

CLEAR WA_NUM.

ENDLOOP.

SORT LT_NUM BY TICK_NO.

DELETE ADJACENT DUPLICATES FROM LT_NUM COMPARING TICK_NO.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

* DDIC_STRUCTURE = ' '

RETFIELD = 'TICK_NO'

* PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

* dynprofield = l_dynprofield

* STEPL = 0

* WINDOW_TITLE =

* VALUE = ' '

VALUE_ORG = C

* MULTIPLE_CHOICE = ' '

* DISPLAY = ' '

* CALLBACK_PROGRAM = ' '

* CALLBACK_FORM = ' '

* MARK_TAB =

* IMPORTING

* USER_RESET =

TABLES

VALUE_TAB = LT_NUM

* FIELD_TAB =

RETURN_TAB = I_RETURN_TAB

* DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 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.

ELSE.

LOOP AT I_RETURN_TAB INTO WA_RETURN.

P_NUM = WA_RETURN-FIELDVAL.

ENDLOOP.

CLEAR:LT_NUM.

ENDIF.

ENDFORM. " F4_HELP_FOR_P_NUM

This program output:

but i need to this type of output

Attachments

output tickno.JPG (88.7 kB)
output.JPG (73.1 kB)