Daynamic Report
TOP Include
*&---------------------------------------------------------------------*
*& Include ZMM_PO_CONDITION_TOP
*&---------------------------------------------------------------------*
TABLES: ekko,ekpo.
DATA: fieldcat TYPE lvc_t_fcat,
gs_fieldcat TYPE LVC_S_FCAT,
g_repid TYPE sy-repid,
a LIKE sy-ucomm.
DATA : GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GS_Field like LINE OF GT_FIELDCAT.
DATA: lt_lines TYPE STANDARD TABLE OF tline,
wa_line TYPE tline,
lv_name TYPE thead-tdname.
DATA: t_newtable TYPE REF TO data.
FIELD-SYMBOLS: TYPE STANDARD TABLE, " Dynamic internal table name
, " Field symbol to create work area
type any. " Field symbol to assign values
TYPES: BEGIN OF ty_final,
ebeln TYPE ekko-ebeln,
matnr TYPE ekpo-matnr,
END OF ty_final.
DATA: lv_borker TYPE char256,
lv_brokerage TYPE char256,
lv_termsofd TYPE char256,
lv_payment TYPE char256.
DATA g_variant LIKE disvariant.
DATA: gt_final TYPE STANDARD TABLE OF ty_final,
gs_final TYPE ty_final.
Main Include
************************************************************************
* Program Name : ZMM_PO_CONDITION *
* Object ID : MM *
* Description : MM PO CONDTION VALUE *
* Create Date : 24-11-2020 *
* FO Owner : *
* Tech Owner : Rohini Kumar *
* Project Module : R2R *
************************************************************************
* Change Log *
************************************************************************
* REQ# DATE WHO CHANGE_ID DESCR *
*-----------------------------------------------------------------------
* 001 Initial *
************************************************************************
REPORT zmm_po_condition.
INCLUDE zmm_po_condition_top.
INCLUDE zmm_po_condition_sel.
INCLUDE zmm_po_condition_sub.
INITIALIZATION.
PERFORM f_clear.
START-OF-SELECTION.
PERFORM f_get_data.
END-OF-SELECTION.
PERFORM f_display.
*&---------------------------------------------------------------------*
*& Include ZMM_PO_CONDITION_SEL
*&---------------------------------------------------------------------*
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
select-OPTIONS: s_werks FOR ekpo-werks,
s_matnr for ekpo-matnr,
s_ebeln for ekko-ebeln,
s_aedat for ekko-aedat OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b1.
sub include
*&---------------------------------------------------------------------*
*& Include ZMM_PO_CONDITION_SUB
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form f_clear
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- --="" .="" endform.="" f_clear="" f_get_data="" form="" p2="" text=""> p1 text
*& <-- .="" 0.="" 1="" add="" aedat="" all="" and="" append="" assign="" at="" call="" cl_alv_table_create="" clear:="" col_pos.="" col_pos="" create="" data:="" data="" dynamic="" ebeln="@gt_ekko-ebeln" ebelp="" ekko="" ekpo="" endif.="" endloop.="" entries="" eq="" f_get_data="" fieldcat-fix_column="X" fieldcat-tabname="GT_FINAL" fieldcat.="" fieldcat="" fieldname="gs_prelments-kschl." fields="" for="" form="" from="" fs="" gs_field-col_pos="col_pos." gs_field-fieldname="gs_prelments-kschl." gs_field-outputlen="17." gs_field-seltext_m="gs_prelments-kschl." gs_field-seltext_s="gs_prelments-kschl." gs_field="" gs_fieldcat-col_pos="col_pos." gs_fieldcat-fieldname="gs_prelments-kschl." gs_fieldcat-lowercase="X" gs_fieldcat-outputlen="17." gs_fieldcat="" gs_prelments="" gt_ekko="" gt_ekpo="" gt_fieldcat.="" gt_prelments="" i="" if="" in="" initial.="" internal="" into="" is="" kappl="" kawrt="" kbetr="" key="" knumv="@gt_ekko-knumv." kschl="" loop="" matnr="" method="" ne="" no="" p2="" prcd_elements="" read="" s_aedat.="" s_ebeln="" s_werks.="" select="" sy-subrc="" table="" text="" to="" transporting="" type="" value="" werks="" where="" with="">create_dynamic_table
EXPORTING
it_fieldcatalog = fieldcat
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO .
APPEND INITIAL LINE TO .
LOOP AT ASSIGNING .
ENDLOOP.
LOOP AT gt_ekpo INTO DATA(gs_ekpo).
READ TABLE gt_ekko INTO DATA(gs_ekko) WITH KEY ebeln = gs_ekpo-ebeln.
IF sy-subrc EQ 0.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE to .
SHIFT gs_ekpo-matnr LEFT DELETING LEADING '0'.
= gs_ekpo-matnr.
ASSIGN COMPONENT 'EBELN' OF STRUCTURE to .
= gs_ekpo-EBELN.
LOOP AT gt_prelments INTO gs_prelments WHERE knumv = gs_ekko-knumv.
ASSIGN COMPONENT gs_prelments-kschl OF STRUCTURE to .
= gs_prelments-kawrt.
CLEAR: gs_prelments.
ENDLOOP.
ENDIF.
APPEND to .
CLEAR: gs_ekko,gs_ekpo.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form f_display
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- .="" append="" f_display="" form="" fs_dyntable="" p2="" text=""> TO .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'F_USER_COMMAND'
it_fieldcat = gt_fieldcat
* i_grid_title = i_grid_title
i_save = 'U' "User layout
* IS_VARIANT = G_VARIANT "User layout
TABLES
t_outtab =
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. --> -->-->
<-- --="" .="" endform.="" f_clear="" f_get_data="" form="" p2="" text=""><-- .="" 0.="" 1="" add="" aedat="" all="" and="" append="" assign="" at="" call="" cl_alv_table_create="" clear:="" col_pos.="" col_pos="" create="" data:="" data="" dynamic="" ebeln="@gt_ekko-ebeln" ebelp="" ekko="" ekpo="" endif.="" endloop.="" entries="" eq="" f_get_data="" fieldcat-fix_column="X" fieldcat-tabname="GT_FINAL" fieldcat.="" fieldcat="" fieldname="gs_prelments-kschl." fields="" for="" form="" from="" fs="" gs_field-col_pos="col_pos." gs_field-fieldname="gs_prelments-kschl." gs_field-outputlen="17." gs_field-seltext_m="gs_prelments-kschl." gs_field-seltext_s="gs_prelments-kschl." gs_field="" gs_fieldcat-col_pos="col_pos." gs_fieldcat-fieldname="gs_prelments-kschl." gs_fieldcat-lowercase="X" gs_fieldcat-outputlen="17." gs_fieldcat="" gs_prelments="" gt_ekko="" gt_ekpo="" gt_fieldcat.="" gt_prelments="" i="" if="" in="" initial.="" internal="" into="" is="" kappl="" kawrt="" kbetr="" key="" knumv="@gt_ekko-knumv." kschl="" loop="" matnr="" method="" ne="" no="" p2="" prcd_elements="" read="" s_aedat.="" s_ebeln="" s_werks.="" select="" sy-subrc="" table="" text="" to="" transporting="" type="" value="" werks="" where="" with=""><-- .="" append="" f_display="" form="" fs_dyntable="" p2="" text=""> --> -->-->
********************************ROHINI KUMAR*********************************
Please support my work : sap.rohini988@gmail.com LinkedIn Link : https://www.linkedin.com/in/rohini-kumar-14647a13a/
********************************************************************************
Comments
Post a Comment