Skip to Content
author's profile photo Former Member
Former Member

Program Modification

hello experts

I have the following ALV report, (ZBB Program) <b>Material Document Listing Report</b>

Currently this report let us drill down to some transaction where we would see standard costs(Drill down fields are Customer and Mterial number) Now, we would like to create

a similar Report (ZBBn)

that will not let us drill down to any transaction where we would see standard costs. we would like to make this avaialable to sales administrative assistants,

The Report should display the fields with no drill down features, Please check ZBB program below, i would appreciate if anybody could modify the program in such a way it is executable. Please highlight the chaged code.

Thanks in adavance

Mohan

  • Global data declaration

_____________________________________________________________________

TYPE-POOLS: slis.

TABLES:

msku , " Special Stocks with Customer

makt , " Material Descriptions

mara , " General Material Data

lfa1,

mbew , " Material Valuation

ser01 , " Document Header for Serial Numbers for Delivery

lips , " SD document: Delivery: Item data

vbak , " Sales Document: Header Data

likp , " SD Document: Delivery Header Data

t001w , " Plants/Branches

kna1 , " General Data in Customer Master

eqbs , " Serial Number Stock Segment

bhdgd , " Common data area batch heading routine

objk , " Plant Maintenance Object List

mkpf,

vbpa,

vbap,

pa0001,

mseg,

ekbe," CH03+

t157e," CH05+

vbfa,

t156t,

tbsgt," VS01+

ekpo," VS01

ekko," CH06+

eket," CH06+

marc." CH07+

data z_equnr like equi-equnr." CH06+

SELECTION-SCREEN: BEGIN OF BLOCK dba WITH FRAME TITLE text-001.

SELECT-OPTIONS s_matnr FOR mseg-matnr MEMORY ID mat.

SELECT-OPTIONS s_werks FOR mseg-werks MEMORY ID wrk.

SELECT-OPTIONS s_lgort FOR mseg-lgort MEMORY ID lag.

SELECT-OPTIONS s_charg FOR mseg-charg MEMORY ID cha.

SELECT-OPTIONS s_lifnr FOR mseg-lifnr MEMORY ID lif.

SELECT-OPTIONS s_kunnr FOR mseg-kunnr MEMORY ID kun.

SELECT-OPTIONS s_bwart FOR mseg-bwart MEMORY ID bwa.

SELECT-OPTIONS s_sobkz FOR mseg-sobkz.

SELECT-OPTIONS s_aufnr FOR mseg-aufnr." CH04+

SELECTION-SCREEN END OF BLOCK dba.

SELECTION-SCREEN BEGIN OF BLOCK mkpf WITH FRAME TITLE text-002.

SELECT-OPTIONS s_budat FOR mkpf-budat.

SELECT-OPTIONS s_usnam FOR mkpf-usnam MEMORY ID usr.

SELECT-OPTIONS s_vgart FOR mkpf-vgart.

SELECT-OPTIONS s_xblnr FOR mkpf-xblnr.

SELECTION-SCREEN END OF BLOCK mkpf.

PARAMETERS: p_vari LIKE disvariant-variant.

TYPES : BEGIN OF i_material_doc,

mblnr TYPE mseg-mblnr,

urzei TYPE mseg-urzei,

mjahr TYPE mseg-mjahr,

gjahr TYPE bkpf-gjahr,

lgort TYPE mseg-lgort,

matnr TYPE msku-matnr,

usnam TYPE mkpf-usnam,

xblnr TYPE mkpf-xblnr,

werks TYPE mseg-werks,

belnr TYPE bkpf-belnr,

beln2 TYPE bkpf-belnr,

vgart TYPE mkpf-vgart,

bwart TYPE mseg-bwart,

charg TYPE mseg-charg,

sernr TYPE equi-sernr,

shkzg TYPE mseg-shkzg,

erdat TYPE vbak-erdat,

shday TYPE zalv-shday,

budat TYPE mkpf-budat,

exdat TYPE zalv-exdat,

stprs TYPE mbew-stprs,

kdauf TYPE mseg-kdauf,

ebeln TYPE mseg-ebeln,

maktx TYPE makt-maktx,

kunnr TYPE msku-kunnr,

lifnr TYPE mseg-lifnr,

soname TYPE zalv-soname,

vdname TYPE zalv-shname,

sobkz TYPE msku-sobkz,

dmbtr TYPE mseg-dmbtr,

menge TYPE mseg-menge,

ebelp TYPE mseg-ebelp," CH02+

bualt TYPE mseg-bualt," CH02+

erfmg TYPE mseg-erfmg," CH03+

waers TYPE mseg-waers," CH03+

unit_amt TYPE mseg-bualt," CH03+

unit_amt_lc TYPE mseg-bualt," CH03+

aufnr TYPE mseg-aufnr," CH04+

btext TYPE t156t-btext," EC01+

bezei TYPE tbsgt-bezei," VS01+

grund TYPE mseg-grund," CH05+

grtxt TYPE t157e-grtxt," CH05+

issdt type sy-datum," CH06+

ekgrp type ekko-ekgrp," CH06+

eindt type eket-eindt," CH06+

END OF i_material_doc.

DATA:gt_fieldcat TYPE slis_t_fieldcat_alv.

DATA: i_object_numbers TYPE objk OCCURS 0 WITH HEADER LINE.

DATA: gt_material_doc TYPE i_material_doc OCCURS 0 WITH HEADER LINE.

DATA: i_material_doca TYPE i_material_doc OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF i_serial OCCURS 0,

mblnr TYPE mseg-mblnr,

zeile TYPE mseg-zeile,

gjahr TYPE mseg-gjahr,

matnr TYPE msku-matnr,

b_werk TYPE mseg-werks,

b_charge TYPE mseg-charg,

kunnr TYPE msku-kunnr,

kunwe TYPE msku-kunnr,

objnr TYPE equi-objnr,

sernr TYPE equi-sernr,

END OF i_serial.

DATA: g_repid LIKE sy-repid,

g_count LIKE sy-tabix,

g_record_found(1) TYPE c,

g_total_kulab LIKE mseg-menge,

g_item LIKE lips-posnr,

g_delivery LIKE lips-vbeln,

g_delivery_item LIKE lips-posnr,

g_indicator LIKE scal-indicator,

g_calender_id LIKE scal-fcalid,

g_15days LIKE sy-index,

g_datum LIKE sy-datum,

l_account(1),

g_expected_date LIKE sy-datum.

DATA: g_save(1) TYPE c,

g_exit(1) TYPE c,

gx_variant LIKE disvariant,

g_variant LIKE disvariant.

DATA : BEGIN OF i_account_document OCCURS 0,

belnr TYPE bkpf-belnr,

gjahr TYPE bkpf-gjahr,

END OF i_account_document.

  • Initialization fieldcatalog

INITIALIZATION.

g_repid = sy-repid.

g_save = 'A'.

PERFORM variant_init.

  • Get default variant

gx_variant = g_variant.

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

i_save = g_save

CHANGING

cs_variant = gx_variant

EXCEPTIONS

not_found = 2.

IF sy-subrc = 0.

p_vari = gx_variant-variant.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.

PERFORM f4_for_variant.

AT SELECTION-SCREEN.

PERFORM pai_of_selection_screen.

PERFORM auth_check. "<------ AUTH CHECK

CALL FUNCTION 'MMIM_ENTRYCHECK_MAIN'

TABLES

it_matnr = s_matnr

it_werks = s_werks

it_kunnr = s_kunnr.

START-OF-SELECTION.

SELECT SINGLE * FROM t001w WHERE werks IN s_werks.

IF sy-subrc EQ 0.

g_calender_id = t001w-fabkl.

ENDIF.

  • Data selection

PERFORM select_data TABLES gt_material_doc.

PERFORM fieldcat_init USING gt_fieldcat[].

END-OF-SELECTION.

  • Display list

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_user_command = 'USER_COMMAND'

i_callback_program = g_repid

it_fieldcat = gt_fieldcat[]

is_variant = g_variant

i_save = g_save

TABLES

t_outtab = gt_material_doc.

______________________________________________________________________

FORM select_data TABLES i_material_doc LIKE gt_material_doc[].

DATA: l_status LIKE risa0-statusline,

l_zeile LIKE vbfa-posnn,

l_uepos LIKE vbap-uepos,

l_awkey LIKE bkpf-awkey,

l_record_not_found(1).

  • Read Material Docs For the Selection

SELECT DISTINCT hxblnr dmblnr durzei hmjahr dmatnr dwerks

dkunnr dlifnr dcharg dshkzg dmenge dbwart

hbudat dshkzg dlgort dsobkz h~usnam

hvgart dkdauf d~ebeln

debelp dbualt " CH02+

derfmg ddmbtr d~waers" CH03+

d~aufnr" CH04+

d~grund" CH05+

FROM mkpf AS h INNER JOIN mseg AS d

ON hmandt = dmandt

AND hmblnr = dmblnr

AND hmjahr = dmjahr

APPENDING CORRESPONDING FIELDS OF TABLE i_material_doc

WHERE d~matnr IN s_matnr

AND d~werks IN s_werks

AND h~budat IN s_budat

AND h~vgart IN s_vgart

AND h~xblnr IN s_xblnr

AND h~usnam IN s_usnam

AND d~lgort IN s_lgort

AND d~sobkz IN s_sobkz

AND d~charg IN s_charg

AND d~lifnr IN s_lifnr

AND d~kunnr IN s_kunnr

AND d~bwart IN s_bwart

AND d~aufnr IN s_aufnr." CH04+

SORT i_material_doc BY mblnr urzei.

  • Read Material Document to help in accessing the Serial Number

SELECT hmatnr hsernr dmblnr dmjahr d~zeile

FROM ser03 AS d INNER JOIN objk AS h

ON hobknr = dobknr

APPENDING CORRESPONDING FIELDS OF TABLE i_serial

FOR ALL ENTRIES IN i_material_doc

WHERE h~matnr = i_material_doc-matnr

AND d~mblnr = i_material_doc-mblnr

AND d~werk = i_material_doc-werks

AND d~zeile = i_material_doc-urzei

AND h~objvw = 'S'

AND h~taser = 'SER03'.

SORT i_serial BY mblnr zeile.

LOOP AT i_material_doc.

CLEAR: l_record_not_found.

CONCATENATE i_material_doc-mblnr i_material_doc-mjahr INTO l_awkey.

CLEAR: i_account_document[].

SELECT belnr gjahr INTO TABLE i_account_document

FROM bkpf

WHERE awtyp EQ 'MKPF'

AND awkey EQ l_awkey.

READ TABLE i_account_document INDEX 1.

IF sy-subrc EQ 0.

MOVE: i_account_document-belnr TO i_material_doc-belnr.

ENDIF.

READ TABLE i_account_document INDEX 2.

IF sy-subrc EQ 0.

MOVE: i_account_document-belnr TO i_material_doc-beln2.

l_account = 'X'.

ENDIF.

i_material_doca = i_material_doc.

CLEAR: i_material_doca-sernr.

LOOP AT i_serial WHERE mblnr = i_material_doc-mblnr

AND zeile = i_material_doc-urzei.

MOVE: i_serial-sernr TO i_material_doca-sernr.

MOVE '1.000' TO i_material_doca-menge.

*Begin CH06 Get Issuing date from classification

select single equnr

into z_equnr

from equi

where sernr = i_material_doca-sernr

and matnr = i_material_doca-matnr.

perform get_class_data using

z_equnr

'ISSUING_DATE'

i_material_doca-issdt.

clear z_equnr.

*End CH06

APPEND i_material_doca.

l_record_not_found = 'X'.

ENDLOOP.

IF l_record_not_found EQ space.

APPEND i_material_doca.

ENDIF.

ENDLOOP.

CLEAR: i_material_doc[].

DELETE i_material_doca WHERE menge EQ 0

AND erfmg EQ 0." CH03+

LOOP AT i_material_doca.

i_material_doca-unit_amt = " CH03+

i_material_doca-bualt / i_material_doca-erfmg." CH03+

i_material_doca-unit_amt_lc = " CH03+

i_material_doca-dmbtr / i_material_doca-erfmg." CH03+

IF i_material_doca-shkzg EQ 'H'.

MULTIPLY i_material_doca-menge BY -1.

MULTIPLY i_material_doca-erfmg BY -1." CH03+

MULTIPLY i_material_doca-bualt BY -1." CH03+

MULTIPLY i_material_doca-dmbtr BY -1." CH03+

MULTIPLY i_material_doca-unit_amt BY -1." CH03+

MULTIPLY i_material_doca-unit_amt_lc BY -1." CH03+

ENDIF.

*CH04 Show unit amts instead of total amts when SN's are displyed

*individually

IF i_material_doca-erfmg <> i_material_doca-menge " CH04+

AND i_material_doca-sernr <> ''" CH04+

AND i_material_doca-menge = 1." CH04+

i_material_doca-bualt = i_material_doca-unit_amt." CH04+

i_material_doca-dmbtr = i_material_doca-unit_amt_lc. " CH04+

ENDIF." CH04+

  • Read Reason for movement

SELECT SINGLE * FROM t157e WHERE bwart = i_material_doca-bwart" CH05+

AND grund = i_material_doca-grund" CH05+

AND spras = 'EN'." CH05+

i_material_doca-grtxt = t157e-grtxt." CH05+

  • Read Customer Name

CLEAR: kna1, i_material_doca-soname.

SELECT SINGLE name1 INTO i_material_doca-soname

FROM kna1 WHERE kunnr EQ i_material_doca-kunnr.

CLEAR: i_material_doca-maktx.

SELECT SINGLE maktx INTO i_material_doca-maktx

FROM makt WHERE spras EQ sy-langu

AND matnr EQ i_material_doca-matnr.

  • Read Vendor Name

CLEAR: kna1, i_material_doca-vdname.

SELECT SINGLE name1 INTO i_material_doca-vdname

FROM lfa1 WHERE lifnr EQ i_material_doca-lifnr.

  • PO item reason for order VS01+

CLEAR: ekpo, i_material_doca-bezei." VS01+

IF NOT i_material_doca-ebeln IS INITIAL." VS01+

SELECT SINGLE * FROM ekpo " VS01+

WHERE ebeln EQ i_material_doca-ebeln" VS01+

AND ebelp EQ i_material_doca-ebelp " VS01+

AND bsgru NE ' ' " VS01+

AND loekz EQ ' '. " VS01+

IF sy-subrc EQ 0." VS01+

SELECT SINGLE bezei INTO i_material_doca-bezei" VS01+

FROM tbsgt WHERE spras EQ sy-langu " VS01+

AND bsgru EQ ekpo-bsgru." VS01+

ENDIF." VS01+

ENDIF." VS01+

*CH07 Removed lines, getting Buyer code from Marc instead

  • Read PO header for Buyer Code

  • CLEAR: ekko, i_material_doca-ekgrp." CH06+

  • IF NOT i_material_doca-ebeln IS INITIAL." CH06+

  • SELECT single ekgrp into i_material_doca-ekgrp" CH06+

  • FROM ekko " CH06+

  • WHERE ebeln EQ i_material_doca-ebeln." CH06+

  • ENDIF." CH06+

CLEAR: marc, i_material_doca-ekgrp." CH07+

SELECT single ekgrp into i_material_doca-ekgrp" CH07+

FROM marc " CH07+

WHERE matnr EQ i_material_doca-matnr " CH07+

AND werks EQ i_material_doca-werks." CH07+

  • Read PO schedule line for delivery dt

CLEAR: eket, i_material_doca-eindt." CH06+

IF NOT i_material_doca-ebeln IS INITIAL." CH06+

SELECT single eindt into i_material_doca-eindt" CH06+

FROM eket " CH06+

WHERE ebeln EQ i_material_doca-ebeln" CH06+

AND ebelp EQ i_material_doca-ebelp." CH06+

ENDIF." CH06+

APPEND i_material_doca TO i_material_doc.

ENDLOOP.

LOOP AT i_material_doc.

SELECT SINGLE btext FROM t156t INTO i_material_doc-btext

WHERE bwart = i_material_doc-bwart AND spras = 'EN'.

MODIFY i_material_doc.

CLEAR: i_material_doc.

ENDLOOP.

ENDFORM. " FORM

  • Initialization fieldcatalog

FORM fieldcat_init

USING rt_fieldcat TYPE slis_t_fieldcat_alv.

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

DATA: pos TYPE i VALUE 1.

IF sy-langu = 'E'.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'WERKS'.

ls_fieldcat-seltext_s = 'Plant '.

ls_fieldcat-seltext_m = 'Plant'.

ls_fieldcat-seltext_l = 'Plant'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'LGORT'.

ls_fieldcat-seltext_s = 'Storage Loc'.

ls_fieldcat-seltext_m = 'Storage Loc'.

ls_fieldcat-seltext_l = 'Storage Loc'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BWART'.

ls_fieldcat-seltext_s = 'Mov Type'.

ls_fieldcat-seltext_m = 'Mov Type'.

ls_fieldcat-seltext_l = 'Movement Type'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BTEXT'.

ls_fieldcat-seltext_s = 'Text-Mov Type'.

ls_fieldcat-seltext_m = 'Text-Mov Type'.

ls_fieldcat-seltext_l = 'Text-Movement Type'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'XBLNR'.

ls_fieldcat-seltext_s = 'Ref Doc'.

ls_fieldcat-seltext_m = 'Reference Doc'.

ls_fieldcat-seltext_l = 'Reference Doc Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BUDAT'.

ls_fieldcat-seltext_s = 'Posting Date'.

ls_fieldcat-seltext_m = 'Posting Date'.

ls_fieldcat-seltext_l = 'Posting Date'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SOBKZ'.

ls_fieldcat-seltext_s = 'Special Stock'.

ls_fieldcat-seltext_m = 'Special Stock'.

ls_fieldcat-seltext_l = 'Special Stock'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MBLNR'.

ls_fieldcat-seltext_s = 'Material Doc'.

ls_fieldcat-seltext_m = 'Material Doc'.

ls_fieldcat-seltext_l = 'Material Doc Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'URZEI'.

ls_fieldcat-seltext_s = 'Item'.

ls_fieldcat-seltext_m = 'Item'.

ls_fieldcat-seltext_l = 'Material Document Item'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MATNR'.

ls_fieldcat-seltext_s = 'Material'.

ls_fieldcat-seltext_m = 'Material No'.

  • ls_fieldcat-seltext_l = 'Material Numner'.

ls_fieldcat-seltext_l = 'Material Number'." CH01+

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MAKTX'.

ls_fieldcat-seltext_s = 'Description'.

ls_fieldcat-seltext_m = 'Material Description'.

ls_fieldcat-seltext_l = 'Material Description'.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'USNAM'.

ls_fieldcat-seltext_s = 'User'.

ls_fieldcat-seltext_m = 'Created By'.

ls_fieldcat-seltext_l = 'Created By'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'CHARG'.

ls_fieldcat-seltext_s = 'Batch'.

ls_fieldcat-seltext_m = 'Batch No'.

ls_fieldcat-seltext_l = 'Batch Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'KUNNR'.

ls_fieldcat-seltext_s = 'Customer'.

ls_fieldcat-seltext_m = 'Customer'.

ls_fieldcat-seltext_l = 'Customer'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SONAME'.

ls_fieldcat-seltext_s = 'Customer Name '.

ls_fieldcat-seltext_m = 'Customer Name'.

ls_fieldcat-seltext_l = 'Customer Name'.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'LIFNR'.

ls_fieldcat-seltext_s = 'Vendor'.

ls_fieldcat-seltext_m = 'Vendor'.

ls_fieldcat-seltext_l = 'Vendor'..

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'VDNAME'.

ls_fieldcat-seltext_s = 'Vendor Name '.

ls_fieldcat-seltext_m = 'Vendor Name'.

ls_fieldcat-seltext_l = 'Vendor Name'.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SERNR'.

ls_fieldcat-ref_fieldname = 'SERNR'.

ls_fieldcat-outputlen = '18'.

ls_fieldcat-seltext_s = 'Serial Number'.

ls_fieldcat-seltext_m = 'Serial Number'.

ls_fieldcat-seltext_l = 'Serial Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BELNR'.

ls_fieldcat-seltext_s = 'Account Doc'.

ls_fieldcat-seltext_m = 'Accounting Doc'.

ls_fieldcat-seltext_l = 'Accounting Document'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

IF l_account = 'X'.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BELN2'.

ls_fieldcat-seltext_s = 'Account Doc2'.

ls_fieldcat-seltext_m = 'Accounting Doc2'.

ls_fieldcat-seltext_l = 'Accounting Document2'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

ENDIF.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'KDAUF'.

ls_fieldcat-seltext_s = 'Sales Order'.

ls_fieldcat-seltext_m = 'Sales Order '.

ls_fieldcat-seltext_l = 'Sales Order Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'EBELN'.

ls_fieldcat-seltext_s = 'Purchase Ord'.

ls_fieldcat-seltext_m = 'Purchase Order '.

ls_fieldcat-seltext_l = 'Purchase Order Number'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1." CH02+

ls_fieldcat-col_pos = pos." CH02+

ls_fieldcat-fieldname = 'EBELP'." CH02+

ls_fieldcat-seltext_s = 'PO Line'." CH02+

ls_fieldcat-seltext_m = 'PO Line'." CH02+

ls_fieldcat-seltext_l = 'PO Line'." CH02+

APPEND ls_fieldcat TO rt_fieldcat." CH02+

CLEAR ls_fieldcat." CH02+

pos = pos + 1." CH02+

ls_fieldcat-col_pos = pos." CH02+

ls_fieldcat-fieldname = 'BUALT'." CH02+

ls_fieldcat-seltext_s = 'Amount'." CH02+

ls_fieldcat-seltext_m = 'Amount'." CH02+

ls_fieldcat-seltext_l = 'Amount'." CH02+

ls_fieldcat-do_sum = 'X'." CH02+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH02+

CLEAR ls_fieldcat." CH02+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'DMBTR'." CH03+

ls_fieldcat-seltext_s = 'Amt LC'." CH03+

ls_fieldcat-seltext_m = 'Amt LCurr'." CH03+

ls_fieldcat-seltext_l = 'Amt Local Curr'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'UNIT_AMT'." CH03+

ls_fieldcat-seltext_s = 'Unit Amt'." CH03+

ls_fieldcat-seltext_m = 'Unit Amt'." CH03+

ls_fieldcat-seltext_l = 'Unit Amount'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'UNIT_AMT_LC'." CH03+

ls_fieldcat-seltext_s = 'Unit Amt LC'." CH03+

ls_fieldcat-seltext_m = 'Unit Amt LC'." CH03+

ls_fieldcat-seltext_l = 'Unit Amount LC'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'WAERS'." CH03+

ls_fieldcat-seltext_s = 'Curr'." CH03+

ls_fieldcat-seltext_m = 'Currency'." CH03+

ls_fieldcat-seltext_l = 'Currency'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'ERFMG'." CH03+

ls_fieldcat-seltext_s = 'Qty UnE'." CH03+

ls_fieldcat-seltext_m = 'Qty in UnE'." CH03+

ls_fieldcat-seltext_l = 'Qty in Unit Entry'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH04+

ls_fieldcat-col_pos = pos." CH04+

ls_fieldcat-fieldname = 'AUFNR'." CH04+

ls_fieldcat-seltext_s = 'Order'." CH04+

ls_fieldcat-seltext_m = 'Work Order'." CH04+

ls_fieldcat-seltext_l = 'Work Order'." CH04+

ls_fieldcat-do_sum = 'X'." CH04+

ls_fieldcat-no_out = 'X'." CH04+

APPEND ls_fieldcat TO rt_fieldcat." CH04+

CLEAR ls_fieldcat." CH04+

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MENGE'.

ls_fieldcat-seltext_s = 'Inventory'.

ls_fieldcat-seltext_m = 'Inventory'.

ls_fieldcat-seltext_l = 'Inventory'.

ls_fieldcat-do_sum = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1." VS01+

ls_fieldcat-col_pos = pos." VS01+

ls_fieldcat-fieldname = 'BEZEI'." VS01+

ls_fieldcat-seltext_s = 'PO Reason for Order'." VS01+

ls_fieldcat-seltext_m = 'PO Reason for Order'." VS01+

ls_fieldcat-seltext_l = 'PO Reason for Order'." VS01+

APPEND ls_fieldcat TO rt_fieldcat." VS01+

CLEAR ls_fieldcat." VS01+

pos = pos + 1." CH05+

ls_fieldcat-col_pos = pos." CH05+

ls_fieldcat-fieldname = 'GRUND'." CH05+

ls_fieldcat-seltext_s = 'Reason Cd'." CH05+

ls_fieldcat-seltext_m = 'Reason Code'." CH05+

ls_fieldcat-seltext_l = 'Reason for Movement Cd'." CH05+

APPEND ls_fieldcat TO rt_fieldcat." CH05+

CLEAR ls_fieldcat." CH05+

pos = pos + 1." CH05+

ls_fieldcat-col_pos = pos." CH05+

ls_fieldcat-fieldname = 'GRTXT'." CH05+

ls_fieldcat-seltext_s = 'Reason Desc'." CH05+

ls_fieldcat-seltext_m = 'Reason Desc'." CH05+

ls_fieldcat-seltext_l = 'Reason for Movement Desc'." CH05+

APPEND ls_fieldcat TO rt_fieldcat." CH05+

CLEAR ls_fieldcat." CH05+

pos = pos + 1." CH06+

ls_fieldcat-col_pos = pos." CH06+

ls_fieldcat-fieldname = 'ISSDT'." CH06+

ls_fieldcat-seltext_s = 'Issuing Dt'." CH06+

ls_fieldcat-seltext_m = 'Issuing Date'." CH06+

ls_fieldcat-seltext_l = 'Issuing Date'." CH06+

APPEND ls_fieldcat TO rt_fieldcat." CH06+

CLEAR ls_fieldcat." CH06+

pos = pos + 1." CH06+

ls_fieldcat-col_pos = pos." CH06+

ls_fieldcat-fieldname = 'EKGRP'." CH06+

ls_fieldcat-seltext_s = 'Buyer'." CH06+

ls_fieldcat-seltext_m = 'Buyer Cd'." CH06+

ls_fieldcat-seltext_l = 'Buyer Cd'." CH06+

APPEND ls_fieldcat TO rt_fieldcat." CH06+

CLEAR ls_fieldcat." CH06+

pos = pos + 1." CH06+

ls_fieldcat-col_pos = pos." CH06+

ls_fieldcat-fieldname = 'EINDT'." CH06+

ls_fieldcat-seltext_s = 'Deliv Dt'." CH06+

ls_fieldcat-seltext_m = 'Delivery Dt'." CH06+

ls_fieldcat-seltext_l = 'Delivery Date'." CH06+

APPEND ls_fieldcat TO rt_fieldcat." CH06+

CLEAR ls_fieldcat." CH06+

ENDIF.

*Espanol

IF sy-langu = 'S'.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'WERKS'.

ls_fieldcat-seltext_s = 'Centro '.

ls_fieldcat-seltext_m = 'Centro'.

ls_fieldcat-seltext_l = 'Centro'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'LGORT'.

ls_fieldcat-seltext_s = 'Almacén'.

ls_fieldcat-seltext_m = 'Almacén'.

ls_fieldcat-seltext_l = 'Almacén'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BWART'.

ls_fieldcat-seltext_s = 'Clase de movimiento'.

ls_fieldcat-seltext_m = 'Clase de movimiento'.

ls_fieldcat-seltext_l = 'Clase de movimiento'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BTEXT'.

ls_fieldcat-seltext_s = 'Texto-movimiento'.

ls_fieldcat-seltext_m = 'Texto-movimiento'.

ls_fieldcat-seltext_l = 'Texto-movimiento'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'XBLNR'.

ls_fieldcat-seltext_s = 'Documento de referencia'.

ls_fieldcat-seltext_m = 'Documento de referencia'.

ls_fieldcat-seltext_l = 'Documento de referencia'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BUDAT'.

ls_fieldcat-seltext_s = 'Fijación De la Fecha '.

ls_fieldcat-seltext_m = 'Fijación De la Fecha '.

ls_fieldcat-seltext_l = 'Fijación De la Fecha '.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SOBKZ'.

ls_fieldcat-seltext_s = 'Stock especial'.

ls_fieldcat-seltext_m = 'Stock especial'.

ls_fieldcat-seltext_l = 'Stock especial'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MBLNR'.

ls_fieldcat-seltext_s = 'Documento Material '.

ls_fieldcat-seltext_m = 'Documento Material '.

ls_fieldcat-seltext_l = 'Documento Material '.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'URZEI'.

ls_fieldcat-seltext_s = 'Artículo '.

ls_fieldcat-seltext_m = 'Artículo '.

ls_fieldcat-seltext_l = 'Artículo Material'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MATNR'.

ls_fieldcat-seltext_s = 'Materiales'.

ls_fieldcat-seltext_m = 'Materiales'.

  • ls_fieldcat-seltext_l = 'Material Numner'.

ls_fieldcat-seltext_l = 'Materiales'." CH01+

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MAKTX'.

ls_fieldcat-seltext_s = 'Descripción Material '.

ls_fieldcat-seltext_m = 'Descripción Material '.

ls_fieldcat-seltext_l = 'Descripción Material '.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'USNAM'.

ls_fieldcat-seltext_s = 'Usuario'.

ls_fieldcat-seltext_m = 'Creado Cerca'.

ls_fieldcat-seltext_l = 'Creado Cerca'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'CHARG'.

ls_fieldcat-seltext_s = 'Lote'.

ls_fieldcat-seltext_m = 'Lote'.

ls_fieldcat-seltext_l = 'Lote'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'KUNNR'.

ls_fieldcat-seltext_s = 'Cliente'.

ls_fieldcat-seltext_m = 'Cliente'.

ls_fieldcat-seltext_l = 'Cliente'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SONAME'.

ls_fieldcat-seltext_s = 'Nombre de Cliente'.

ls_fieldcat-seltext_m = 'Nombre de Cliente'.

ls_fieldcat-seltext_l = 'Nombre de Cliente'.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'LIFNR'.

ls_fieldcat-seltext_s = 'Proveedor'.

ls_fieldcat-seltext_m = 'Proveedor'.

ls_fieldcat-seltext_l = 'Proveedor'..

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'VDNAME'.

ls_fieldcat-seltext_s = 'Nombre de Proveedor'.

ls_fieldcat-seltext_m = 'Nombre de Proveedor'.

ls_fieldcat-seltext_l = 'Nombre de Proveedor'.

ls_fieldcat-no_out = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'SERNR'.

ls_fieldcat-ref_fieldname = 'SERNR'.

ls_fieldcat-outputlen = '18'.

ls_fieldcat-seltext_s = 'Serie'.

ls_fieldcat-seltext_m = 'Serie'.

ls_fieldcat-seltext_l = 'Serie'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BELNR'.

ls_fieldcat-seltext_s = 'Documento De Contabilidad'.

ls_fieldcat-seltext_m = 'Documento De Contabilidad'.

ls_fieldcat-seltext_l = 'Documento De Contabilidad'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

IF l_account = 'X'.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'BELN2'.

ls_fieldcat-seltext_s = 'Dos-Documento De Contabilidad'.

ls_fieldcat-seltext_m = 'Dos-Documento De Contabilidad'.

ls_fieldcat-seltext_l = 'Dos-Documento De Contabilidad'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

ENDIF.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'KDAUF'.

ls_fieldcat-seltext_s = 'Pedidos de Venta'.

ls_fieldcat-seltext_m = 'Pedidos de Venta '.

ls_fieldcat-seltext_l = 'Pedidos de Venta'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'EBELN'.

ls_fieldcat-seltext_s = 'Tipo de Orden'.

ls_fieldcat-seltext_m = 'Tipo de Orden'.

ls_fieldcat-seltext_l = 'Tipo de Orden'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1." CH02+

ls_fieldcat-col_pos = pos." CH02+

ls_fieldcat-fieldname = 'EBELP'." CH02+

ls_fieldcat-seltext_s = 'PO Línea'." CH02+

ls_fieldcat-seltext_m = 'PO Línea'." CH02+

ls_fieldcat-seltext_l = 'PO Línea'." CH02+

APPEND ls_fieldcat TO rt_fieldcat." CH02+

CLEAR ls_fieldcat." CH02+

pos = pos + 1." CH02+

ls_fieldcat-col_pos = pos." CH02+

ls_fieldcat-fieldname = 'BUALT'." CH02+

ls_fieldcat-seltext_s = 'Cantidad '." CH02+

ls_fieldcat-seltext_m = 'Cantidad '." CH02+

ls_fieldcat-seltext_l = 'Cantidad '." CH02+

ls_fieldcat-do_sum = 'X'." CH02+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH02+

CLEAR ls_fieldcat." CH02+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'DMBTR'." CH03+

ls_fieldcat-seltext_s = 'Cantidad Moneda Local'. " CH03+

ls_fieldcat-seltext_m = 'ACantidad Moneda Local'. " CH03+

ls_fieldcat-seltext_l = 'Cantidad Moneda Local'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'UNIT_AMT'." CH03+

ls_fieldcat-seltext_s = 'Cantidad De la Unidad '." CH03+

ls_fieldcat-seltext_m = 'Cantidad De la Unidad '." CH03+

ls_fieldcat-seltext_l = 'Cantidad De la Unidad '." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'UNIT_AMT_LC'." CH03+

ls_fieldcat-seltext_s = 'Unit Amt LC'." CH03+

ls_fieldcat-seltext_m = 'Unit Amt LC'." CH03+

ls_fieldcat-seltext_l = 'Unit Amount LC'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'WAERS'." CH03+

ls_fieldcat-seltext_s = 'Moneda'." CH03+

ls_fieldcat-seltext_m = 'Moneda'." CH03+

ls_fieldcat-seltext_l = 'Moneda'." CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH03+

ls_fieldcat-col_pos = pos." CH03+

ls_fieldcat-fieldname = 'ERFMG'." CH03+

ls_fieldcat-seltext_s = 'Cantidad en entrada de la unidad'."CH03+

ls_fieldcat-seltext_m = 'Cantidad en entrada de la unidad'."CH03+

ls_fieldcat-seltext_l = 'Cantidad en entrada de la unidad'."CH03+

ls_fieldcat-do_sum = 'X'." CH03+

ls_fieldcat-no_out = 'X'." CH03+

APPEND ls_fieldcat TO rt_fieldcat." CH03+

CLEAR ls_fieldcat." CH03+

pos = pos + 1." CH04+

ls_fieldcat-col_pos = pos." CH04+

ls_fieldcat-fieldname = 'AUFNR'." CH04+

ls_fieldcat-seltext_s = 'Orden De Trabajo '." CH04+

ls_fieldcat-seltext_m = 'Orden De Trabajo '." CH04+

ls_fieldcat-seltext_l = 'Orden De Trabajo '." CH04+

ls_fieldcat-do_sum = 'X'." CH04+

ls_fieldcat-no_out = 'X'." CH04+

APPEND ls_fieldcat TO rt_fieldcat." CH04+

CLEAR ls_fieldcat." CH04+

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'MENGE'.

ls_fieldcat-seltext_s = 'Inventario'.

ls_fieldcat-seltext_m = 'Inventario'.

ls_fieldcat-seltext_l = 'Inventario'.

ls_fieldcat-do_sum = 'X'.

APPEND ls_fieldcat TO rt_fieldcat.

CLEAR ls_fieldcat.

pos = pos + 1." VS01+

ls_fieldcat-col_pos = pos." VS01+

ls_fieldcat-fieldname = 'BEZEI'." VS01+

ls_fieldcat-seltext_s = 'Razón de orden de compra'." VS01+

ls_fieldcat-seltext_m = 'Razón de orden de compra'." VS01+

ls_fieldcat-seltext_l = 'Razón de orden de compra'." VS01+

APPEND ls_fieldcat TO rt_fieldcat." VS01+

CLEAR ls_fieldcat." VS01+

pos = pos + 1." CH05+

ls_fieldcat-col_pos = pos." CH05+

ls_fieldcat-fieldname = 'GRUND'." CH05+

ls_fieldcat-seltext_s = 'Código De Razón '." CH05+

ls_fieldcat-seltext_m = 'Código De Razón '." CH05+

ls_fieldcat-seltext_l = 'Razón del movimiento '." CH05+

APPEND ls_fieldcat TO rt_fieldcat." CH05+

CLEAR ls_fieldcat." CH05+

pos = pos + 1." CH05+

ls_fieldcat-col_pos = pos." CH05+

ls_fieldcat-fieldname = 'GRTXT'." CH05+

ls_fieldcat-seltext_s = 'Descripción De la Razón '." CH05+

ls_fieldcat-seltext_m = 'Descripción De la Razón '." CH05+

ls_fieldcat-seltext_l = 'Descripción De la Razón '." CH05+

APPEND ls_fieldcat TO rt_fieldcat." CH05+

CLEAR ls_fieldcat." CH05+

pos = pos + 1." CH06+

ls_fieldcat-col_pos = pos." CH06+

ls_fieldcat-fieldname = 'ISSDT'." CH06+

ls_fieldcat-seltext_s = 'Fecha de Salida'." CH06+

ls_fieldcat-seltext_m = 'Fecha de Salida'." CH06+

ls_fieldcat-seltext_l = 'Fecha de Salida'." CH06+

APPEND ls_fieldcat TO rt_fieldcat." CH06+

CLEAR ls_fieldcat." CH06+

ENDIF.

ENDFORM.

*----


*

" fieldcat_init

*----


*

  • Authority_check

*----


*

FORM auth_check.

TABLES: t001l.

SELECT * FROM t001l WHERE werks IN s_werks.

AUTHORITY-CHECK OBJECT 'M_MATE_WRK'

ID 'WERKS' FIELD t001l-werks.

IF sy-subrc NE 0.

MESSAGE e006 WITH sy-uname.

ENDIF.

ENDSELECT.

IF sy-subrc NE 0.

MESSAGE e007.

ENDIF.

ENDFORM. " auth_check

*&----

-


*& Form USER_COMMAND

*&----

-


FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

PERFORM display_sales_order USING r_ucomm

rs_selfield.

ENDCASE.

ENDFORM.

*&----


*

*& Form display_sales_order

*&----


*

  • text

*----


*

  • -->P_R_UCOMM text

  • -->P_RS_SELFIELD text

*----


*

FORM display_sales_order USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

READ TABLE gt_material_doc INDEX rs_selfield-tabindex.

CASE rs_selfield-sel_tab_field.

WHEN '1-MBLNR'.

SET PARAMETER ID 'MBN' FIELD rs_selfield-value.

SET PARAMETER ID 'MJA' FIELD gt_material_doc-mjahr.

CALL FUNCTION 'MIGO_DIALOG'

EXPORTING

i_action = 'A04'

i_refdoc = 'R02'

i_notree = 'X'

i_no_auth_check = ' '

i_deadend = 'X'

i_skip_first_screen = 'X'

i_okcode = 'OK_GO'

i_mblnr = gt_material_doc-mblnr

i_mjahr = gt_material_doc-mjahr.

WHEN '1-MATNR'.

SET PARAMETER ID 'MAT' FIELD rs_selfield-value.

SET PARAMETER ID 'WRK' FIELD gt_material_doc-werks.

SET PARAMETER ID 'MXX' FIELD 'E'.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

WHEN '1-EBELN'.

SET PARAMETER ID 'BES' FIELD rs_selfield-value.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

WHEN '1-LIFNR'.

SELECT SINGLE * FROM t001w WHERE werks EQ gt_material_doc-werks.

SET PARAMETER ID 'LIF' FIELD rs_selfield-value.

SET PARAMETER ID 'BUK' FIELD t001w-vkorg .

SET PARAMETER ID 'EKO' FIELD t001w-ekorg.

CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.

WHEN '1-KUNNR'.

SELECT SINGLE * FROM t001w WHERE werks EQ gt_material_doc-werks.

SET PARAMETER ID 'KUN' FIELD rs_selfield-value.

SET PARAMETER ID 'VKO' FIELD t001w-vkorg.

SET PARAMETER ID 'VTW' FIELD t001w-vtweg.

SET PARAMETER ID 'SPA' FIELD t001w-spart.

CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

WHEN '1-KDAUF'.

SET PARAMETER ID 'AUN' FIELD rs_selfield-value.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

WHEN '1-BELNR'.

SELECT SINGLE * FROM t001w WHERE werks EQ gt_material_doc-werks.

SET PARAMETER ID 'BUK' FIELD t001w-vkorg.

SET PARAMETER ID 'BLN' FIELD gt_material_doc-belnr.

SET PARAMETER ID 'GJR' FIELD gt_material_doc-mjahr.

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.

WHEN '1-AUFNR'." CH04+

SET PARAMETER ID 'ANR' FIELD rs_selfield-value." CH04+

CALL TRANSACTION 'CO03' AND SKIP FIRST SCREEN." CH04+

ENDCASE.

ENDFORM.

*&----


*

*& Form VARIANT_INIT

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM variant_init.

*

CLEAR g_variant.

g_variant-report = g_repid.

ENDFORM. " VARIANT_INIT

*&----


*

*& Form F4_FOR_VARIANT

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM f4_for_variant.

*

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = g_variant

i_save = g_save

  • it_default_fieldcat =

IMPORTING

e_exit = g_exit

es_variant = gx_variant

EXCEPTIONS

not_found = 2.

IF sy-subrc = 2.

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

IF g_exit = space.

p_vari = gx_variant-variant.

ENDIF.

ENDIF.

ENDFORM.

*----


*

  • FORM pai_of_selection_screen *

*----


*

  • ........ *

*----


*

FORM pai_of_selection_screen.

*

IF NOT p_vari IS INITIAL.

MOVE g_variant TO gx_variant.

MOVE p_vari TO gx_variant-variant.

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'

EXPORTING

i_save = g_save

CHANGING

cs_variant = gx_variant.

g_variant = gx_variant.

ELSE.

PERFORM variant_init.

ENDIF.

ENDFORM.

*----

-


*Begin CH06

*&----


*

*& Form get_class_data

*&----


*

  • text

*----


*

  • -->P_AENR(15) text

  • -->p_atnam text

  • -->P_Z_REAS_CD text

*----


*

form get_class_data using p_equnr

p_atnam

p_atflv.

data: l_atinn like ausp-atinn,

l_atflv like ausp-atflv,

l_tmp_date(8),

l_int TYPE i.

clear: l_atinn,

l_atflv.

select single atinn into l_atinn

from cabn

where atnam = p_atnam.

select atflv into l_atflv from ausp

where objek = p_equnr

and atinn = l_atinn

and klart = '002'.

l_int = l_atflv.

l_tmp_date = l_int.

move: l_tmp_date to p_atflv.

endselect.

endform. " get_class_data

*End CH06

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 01:56 AM

    Hi

    If i can understand correctly, i guess you can acheive the same by commenting the below highlighted line. Please check for the same.

    *&----


    *& Form USER_COMMAND

    *&----


    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    CASE r_ucomm.

    WHEN '&IC1'.

    <b>*PERFORM display_sales_order USING r_ucomm</b>rs_selfield.

    ENDCASE.

    ENDFORM.

    Also i guess you can use the same program, and place an authorization check for ppl to see or not see the later data.

    Hope this can help you.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.