customer details Reports
*&---------------------------------------------------------------------*
*& Include ZFI_VENDOR_BALANCE_SUB
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
DATA: companycode TYPE bapi3008_1-comp_code,
vendor TYPE bapi3008_1-vendor,
actual_balance TYPE bapi3008_9,
return TYPE bapireturn.
SELECT a~kunnr,a~name1,b~customer,b~businesspartner,c~partner,c~type,c~idnumber
FROM kna1 AS a INNER JOIN ibupacustomer AS b ON a~kunnr = b~customer INNER JOIN but0id AS c ON b~businesspartner = c~partner
INTO TABLE @DATA(gt_kna1) WHERE kunnr IN @s_kunnr.
IF gt_kna1 IS NOT INITIAL.
LOOP AT gt_kna1 INTO DATA(gs_kna1).
MOVE-CORRESPONDING gs_kna1 TO gs_final.
APPEND gs_final TO gt_final.
CLEAR: gs_kna1,gs_final.
ENDLOOP.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form F_DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM f_display .
DATA: prnt TYPE slis_print_alv,
layt TYPE slis_layout_alv.
layt-zebra = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* i_callback_user_command = 'F_USER_COMMAND'
it_fieldcat = fieldcat[]
i_grid_title = 'customer details'
i_save = 'U' "User layout
* IS_VARIANT = G_VARIANT "User layout
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form F_FIELD_CATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM f_field_catalog .
*FORM SET_ALV_SORTING.
CLEAR : fieldcat ,
fieldcat[].
*
DATA: col_pos TYPE i VALUE IS INITIAL.
DATA: lv_tab TYPE char30.
lv_tab = 'GT_FINAL'.
ADD 1 TO col_pos.
fieldcat-col_pos = col_pos.
fieldcat-fieldname = 'KUNNR'.
fieldcat-tabname = lv_tab.
fieldcat-seltext_l = 'Customer'.
fieldcat-fix_column = 'X'.
fieldcat-just = 'C'.
fieldcat-outputlen = 11.
APPEND fieldcat.
CLEAR fieldcat.
ADD 1 TO col_pos.
fieldcat-col_pos = col_pos.
fieldcat-fieldname = 'NAME1'.
fieldcat-tabname = lv_tab.
fieldcat-seltext_l = 'Customer Name'.
fieldcat-fix_column = 'X'.
fieldcat-just = 'C'.
fieldcat-outputlen = 11.
APPEND fieldcat.
CLEAR fieldcat.
*
ADD 1 TO col_pos.
fieldcat-col_pos = col_pos.
fieldcat-fieldname = 'BUSINESSPARTNER'.
fieldcat-tabname = lv_tab.
fieldcat-seltext_l = 'Business Partner'.
* fieldcat-fix_column = 'X'.
fieldcat-just = 'C'.
fieldcat-outputlen = 10.
APPEND fieldcat.
CLEAR fieldcat.
ADD 1 TO col_pos.
fieldcat-col_pos = col_pos.
fieldcat-fieldname = 'TYPE'.
fieldcat-tabname = lv_tab.
fieldcat-seltext_l = 'Identification Type'.
* fieldcat-fix_column = 'X'.
fieldcat-just = 'C'.
fieldcat-outputlen = 10.
APPEND fieldcat.
CLEAR fieldcat.
ADD 1 TO col_pos.
fieldcat-col_pos = col_pos.
fieldcat-fieldname = 'IDNUMBER'.
fieldcat-tabname = lv_tab.
fieldcat-seltext_l = 'Identification number'.
* fieldcat-fix_column = 'X'.
fieldcat-just = 'C'.
fieldcat-outputlen = 10.
APPEND fieldcat.
CLEAR fieldcat.
ENDFORM.
Please support my work : sap.rohini988@gmail.com
SAP Training in Gurgaon
ReplyDelete