Items sorted in mb01 selection screen
Hi gurus,
My problem thatu2019s I need that the sequence of the items in the tx.mb01 selection screen might be sorted by material code.
However, the sort of these items is the same that in purchase order. Originally the purchase order is not sorted by material codeu2026so if I try to sort by this code it doesn`t change the assignment to the item number.
What can I do? I canu2019t sort the tx.mb01 selection screen, I can´t change the relation between item number and material code when I sort by material code and this itemu2019s sort is assigned automatically from different purchase requisition, could I parametrize this?
Thankxxxx.....
I do not know any option to achieve this.
But why do you need it? Why didn't you create the PO item sequence in the sequence you need for MB01 if it that important?
Why dont you use MIGO, here you can simply sort by material selecting the column header and then right mouse clic. Sorting is among the enties in the context menu
Similar Messages
-
How to design selection screen with WAD 3.x Web Items
Hi Guruu2019s,
I have a requirement where I need to design a selection screen by using WAD 3.x web items. In the selection screen we have to include the Query Description - in the left corner of the selection screen, Name of Sales Person u2013 left side of the screen, Date from and Date to u2013 right side of the selection screen, User ID and User Name u2013 on the top right of the selection screen etc., after this on the bottom of the selection screen I have to include the pushbutton RUN REPORT.
After filling all the above parameters and click on Run Report it has to trigger another URL link which contains consolidated Sales CRM Report.
Could any one suggest me and provide me the idea on developing the selection screen with WAD 3.x Web items and is there any other interface to trigger the other URL link when I click on Run Report.
Regards
Venkatno replies. Closing the incident
-
At-selection-screen modification
Hi Experts,
I am doing the selection screen modification. The selection screen is designed such as i have two radio buttons 1. header & 2. Item anb beside header radio button i have field sales document number and beside item radio button sales item number field.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-005.
SELECTION-SCREEN: position 32.
parameter:p_sh type c radiobutton group rg. "Sales header
selection-screen: comment 35(15) for field p_sh.
selection-screen: comment 60(20) for field p_vbeln.
parameter:p_vbeln like vbak-vbeln MODIF ID gp5. "Sales Document
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: position 32.
parameter:p_si type c radiobutton group rg. "Sales Item
selection-screen: comment 35(15) for field p_si.
selection-screen: comment 60(20) for field p_posnr.
parameter:p_posnr like vbap-posnr MODIF ID gp6. "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: skip.
This is the selection screen code where for sales document i have assiged Modif id GP5 for Item Modif id GP6. so when i check radio button p_sh ( header ) then sales document ( p_vbeln) shoudl be active for input .
if i check p_si (item) then both saleds document (p_vbeln) and p_posnr both have different group names i.e GP5 & GP6 should be active. i.e screen-inpu = 1.
I have written the following code for header but for item i am unable to make screen-input = 1 for two different groups. how to do that?
LOOP AT SCREEN.
IF ( P_SH NE 'X' AND SCREEN-GROUP1 EQ 'GP5' ) OR
( P_SI NE 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
This code is working when i click header radio button but for when i click item radio button (p_si) only item field is active i am unable to make sales docuemnt active at same time. please help me in this regard.
Regards,
sunil kairam.Hi,
Check this piece of code changed a bit.
PARAMETERS : p_ct RADIOBUTTON GROUP grp .
SELECT-OPTIONS : s_kunnr FOR kna1-kunnr,
PARAMETERS : p_sh RADIOBUTTON GROUP grp.
SELECT-OPTIONS : s_vbeln FOR vbak-vbeln,
PARAMETERS : p_si RADIOBUTTON GROUP grp.
SELECT-OPTIONS : s_vbeln1 FOR vbak-vbeln,
s_posnr for vbak-posnr.
IF p_ct IS NOT INITIAL .
LOOP AT SCREEN.
CASE screen-name.
WHEN 'S_KUNNR-LOW'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'S_KUNNR-HIGH'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'S_VBELN-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_VBELN-HIGH'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_VBELN1-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_VBELN1-HIGH'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_POSNR-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_POSNR-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ELSEIF p_sh IS NOT INITIAL.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'S_KUNNR-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_KUNNR-HIGH'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_VBELN-LOW'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'S_VBELN-HIGH'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'S_VBELN1-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_VBELN1-HIGH'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_POSNR-LOW'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'S_POSNR-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
now one more ELSEIF p_si IS NOT INITIAL
now make s_vbeln1 and s_posnr as input 1 and rest others as input 0.
endif.
Regards,
Nagaraj -
Urgent : selection screen
Hi Experts ,
i am passing sub screens dynamically into the selection screen . IN output i am getting vertical scroll bar in subscreen. my requirement is to avoid scroll bar to that perticular subscreen.
pls send the code how to avoid that scroll bar , here i am sending the coed below ( for 1300 sub screen i am getting scroll bar)
pls do needfull .
Thanks,
Nagendra.
tables
TABLES:
sscrfields,
draw, "Document Info Records
drat, "Texts for Document Info Records
cabn, "Characteristic
cawn, "characteristic values
cawnt, "characteristic value text
ausp, "Characteristic values
tdwa, "Document Types
lfa1, "Vendors
ekko, "Purchasing Documents Header
ekpo, "Purchasing Document items
t023t, "Material Group Descriptions
klah, "Classes
cabnt, "Characteristic descriptions
lfb1, "Vendor master (company Code)
t059t, "texts for minority indicators
tdws, "Document status
tdwst, "Document Status Text
sos04, "SAPoffice: screen fields for function group SO04
t006, "Units of Measurement
tcurx, "Decimal Places in Currencies
*+MD1K960995
ekbe.
Parameters
Program Parameters
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK buyingguide
WITH FRAME TITLE text-104.
Company Code
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-300 FOR FIELD s_bukrs.
SELECT-OPTIONS: s_bukrs FOR ekko-bukrs MEMORY ID buk.
SELECTION-SCREEN END OF LINE.
Purchasing Document Category
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-301 FOR FIELD s_bstyp.
SELECT-OPTIONS: s_bstyp FOR ekko-bstyp DEFAULT 'K'.
SELECTION-SCREEN END OF LINE.
Purchasing Document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-302 FOR FIELD s_bsart.
SELECT-OPTIONS: s_bsart FOR ekko-bsart MEMORY ID bsa.
SELECTION-SCREEN END OF LINE.
Purchasing Document Creation Date
SELECTION-SCREEN BEGIN OF LINE. "MD1K964692
SELECTION-SCREEN COMMENT 1(28) text-303 FOR FIELD s_aedat. "MD1K964692
SELECT-OPTIONS: s_aedat FOR ekko-aedat. "MD1K964692
SELECTION-SCREEN END OF LINE. "MD1K964692
Purchasing Document Creator
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-304 FOR FIELD s_ernam.
SELECT-OPTIONS: s_ernam FOR ekko-ernam.
SELECTION-SCREEN END OF LINE.
Purchasing Document Vendor Account Number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-305 FOR FIELD s_lifnr.
SELECT-OPTIONS: s_lifnr FOR ekko-lifnr MEMORY ID lif.
SELECTION-SCREEN END OF LINE.
Purchasing Organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-306 FOR FIELD s_ekorg.
SELECT-OPTIONS: s_ekorg FOR ekko-ekorg MEMORY ID eko.
SELECTION-SCREEN END OF LINE.
*+G1
Purchasing Group
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-340 FOR FIELD s_ekorg.
SELECT-OPTIONS: s_ekgrp FOR ekko-ekgrp MEMORY ID ekg.
SELECTION-SCREEN END OF LINE.
Purchasing Document date
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-341 FOR FIELD s_ekorg.
SELECT-OPTIONS: s_bedat FOR ekko-bedat MEMORY ID bed.
SELECTION-SCREEN END OF LINE.
Purchasing Document item plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-307 FOR FIELD s_werks.
SELECT-OPTIONS: s_werks FOR ekpo-werks MEMORY ID wrk.
SELECTION-SCREEN END OF LINE.
*+MD1K971124
*+MD1K971479
Number of Purchasing Info Record
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-342 FOR FIELD s_infnr.
SELECT-OPTIONS: s_infnr FOR ekpo-infnr MEMORY ID inf.
SELECTION-SCREEN END OF LINE.
Purchasing Document item material group
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-308 FOR FIELD s_matkl.
SELECT-OPTIONS: s_matkl FOR ekpo-matkl MEMORY ID mkl.
SELECTION-SCREEN END OF LINE.
Purchasing Document item category
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-309 FOR FIELD s_pstyp.
SELECT-OPTIONS: s_pstyp FOR ekpo-pstyp DEFAULT 8 TO 9.
SELECTION-SCREEN END OF LINE.
Purchasing Document item material number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-310 FOR FIELD s_matnr.
SELECT-OPTIONS: s_matnr FOR ekpo-matnr MEMORY ID mat.
SELECTION-SCREEN END OF LINE.
Purchasing Document item deletion indicator
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-311 FOR FIELD s_loekz.
SELECT-OPTIONS: s_loekz FOR ekpo-loekz DEFAULT space.
SELECTION-SCREEN END OF LINE.
Purchasing Document
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-317 FOR FIELD s_ebeln.
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln MEMORY ID vrt.
SELECTION-SCREEN END OF LINE.
Purchasing Document item
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-312 FOR FIELD s_ebelp.
SELECT-OPTIONS: s_ebelp FOR ekpo-ebelp MEMORY ID bsp.
SELECTION-SCREEN END OF LINE.
Purchasing Document item purchase req number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-313 FOR FIELD s_banfn.
SELECT-OPTIONS: s_banfn FOR ekpo-banfn MEMORY ID ban.
SELECTION-SCREEN END OF LINE.
Purchasing Document item reference purchase document
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-318 FOR FIELD s_konnr.
SELECT-OPTIONS: s_konnr FOR ekpo-konnr.
SELECTION-SCREEN END OF LINE.
Purchasing Document item reference purchase document item
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-319 FOR FIELD s_ktpnr.
SELECT-OPTIONS: s_ktpnr FOR ekpo-ktpnr.
SELECTION-SCREEN END OF LINE.
Purchasing Document validity from date
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-314 FOR FIELD s_kdatb.
SELECT-OPTIONS: s_kdatb FOR ekko-kdatb.
SELECTION-SCREEN END OF LINE.
Purchasing Document validity to date
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) text-315 FOR FIELD s_kdate.
SELECT-OPTIONS: s_kdate FOR ekko-kdate DEFAULT sy-datum
TO '99991231'.
SELECTION-SCREEN END OF LINE.
Vendor Rating
SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 1(28) text-316 FOR FIELD s_zmrate.
*SELECT-OPTIONS: s_zmrate FOR ekko-zz_moc_rating.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK buyingguide.
SELECTION-SCREEN END OF SCREEN 1100.
SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK document
WITH FRAME TITLE text-024.
Document number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_dokar FOR FIELD s_dokar.
SELECT-OPTIONS: s_dokar FOR draw-dokar DEFAULT 'CN1'.
SELECTION-SCREEN END OF LINE.
Document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_doknr FOR FIELD s_doknr.
SELECT-OPTIONS: s_doknr FOR draw-doknr.
SELECTION-SCREEN END OF LINE.
Document part
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_doktl FOR FIELD s_doktl.
SELECT-OPTIONS: s_doktl FOR draw-doktl.
SELECTION-SCREEN END OF LINE.
Document version
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_dokvr FOR FIELD s_dokvr.
SELECT-OPTIONS: s_dokvr FOR draw-dokvr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.
Document Status
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_dokst FOR FIELD s_dokst.
SELECT-OPTIONS: s_dokst FOR draw-dokst." DEFAULT 'AC'.
SELECTION-SCREEN END OF LINE.
Document Creation Date
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_adat FOR FIELD s_adat.
SELECT-OPTIONS: s_adat FOR draw-adatum.
SELECTION-SCREEN END OF LINE.
Document Creator
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_dwnam FOR FIELD s_dwnam.
SELECT-OPTIONS: s_dwnam FOR draw-dwnam.
SELECTION-SCREEN END OF LINE.
Document text
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_dktxt FOR FIELD s_dktxt.
SELECT-OPTIONS: s_dktxt FOR drat-dktxt.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.
Parent Document number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_prear FOR FIELD s_prear.
SELECT-OPTIONS: s_prear FOR draw-prear.
SELECTION-SCREEN END OF LINE.
Parent Document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_prenr FOR FIELD s_prenr.
SELECT-OPTIONS: s_prenr FOR draw-prenr.
SELECTION-SCREEN END OF LINE.
Parent Document part
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_pretl FOR FIELD s_pretl.
SELECT-OPTIONS: s_pretl FOR draw-pretl.
SELECTION-SCREEN END OF LINE.
Parent Document version
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(28) c_prevr FOR FIELD s_prevr.
SELECT-OPTIONS: s_prevr FOR draw-prevr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK document.
SELECTION-SCREEN END OF SCREEN 1200.
SELECTION-SCREEN BEGIN OF SCREEN 1300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK charact
WITH FRAME TITLE text-025.
Class
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) c_class FOR FIELD p_class.
PARAMETERS: p_class LIKE klah-class OBLIGATORY
MATCHCODE OBJECT clas
DEFAULT 'CONTRACTS'.
SELECTION-SCREEN END OF LINE.
Class Type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) c_klart FOR FIELD p_klart.
PARAMETERS: p_klart LIKE klah-klart OBLIGATORY DEFAULT '017'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT /1(67) text-203.
SELECTION-SCREEN COMMENT /5(16) text-204.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_01atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_01atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_01atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_02atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_02atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_02atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_03atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_03atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_03atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_05atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_05atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_05atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_04atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_04atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_04atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_06atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_06atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_06atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_07atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_07atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_07atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_08atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_08atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_08atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_09atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_09atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_09atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_10atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_10atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_10atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_11atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_11atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_11atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_12atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_12atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_12atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_13atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_13atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_13atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_14atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_14atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_14atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_15atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_15atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_15atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_16atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_16atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_16atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_17atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_17atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_17atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_18atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_18atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_18atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_19atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_19atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_19atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_20atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_20atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_20atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_21atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_21atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_21atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_22atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_22atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_22atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_23atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_23atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_23atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_24atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_24atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_24atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pc_25atm AS CHECKBOX
MODIF ID chr.
PARAMETERS: pt_25atm LIKE cabn-atnam OBLIGATORY
VISIBLE LENGTH 26
MODIF ID chr.
SELECT-OPTIONS: s_25atm FOR ausp-atwrt
MODIF ID chr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK charact.
SELECTION-SCREEN END OF SCREEN 1300.
Main Selection screen that will incorporate the subscreens
SELECTION-SCREEN BEGIN OF TABBED BLOCK tabs FOR 24 LINES.
SELECTION-SCREEN TAB (20) text-103 USER-COMMAND ucomm1
DEFAULT SCREEN 1100.
SELECTION-SCREEN TAB (20) text-100 USER-COMMAND ucomm2
DEFAULT SCREEN 1200.
SELECTION-SCREEN TAB (30) text-101 USER-COMMAND ucomm3
DEFAULT SCREEN 1300.
SELECTION-SCREEN END OF BLOCK tabs.
SELECTION-SCREEN BEGIN OF BLOCK misc WITH FRAME TITLE text-061.
ALV Variant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) text-066 FOR FIELD p_alvvar.
PARAMETERS: p_alvvar LIKE disvariant-variant. "alv variant
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK misc.hi nagendra,
i got ur problem. i put the subscreen in ur main screen.
i was gone through from ur program. there is number of parameters and select-option. and ur subscreen size is small according to your taken fields.
there is two option
1 ) . make your subscreen size full in main screen .
2) . Or you can put all fields in main screen . it does not matter for codding.
rewards if helpfull. -
How to display the sort value in the selection screen in the report title
Dear All,
How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
Good day,
Thanks and regards
Arun SHi Arun,
Try this.
1, Set one dynamic parameter,
2, Drag and drop that parameter into your report title.
3, Pass the value(sort value) dynamically from your application,
4, Cheers..
Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then set the data source from CR designer. and darg and drop that data column into the report.
Hope this will work,
Regards,
Salah
Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM -
Sorting Currency conversion Variables in Query Selection screen
Hi Experts,
I have an issue in sorting variables.
A Currency translation is used here which has two selection options here, one for "Currency" and one for "Currency conversion date". They just pop in somewhere in the selection screen with out order. I want to put them together either in the middle or at the bottom.
They are not visible in the Variable sequence tab of query properties.
I changed the text for each of them (Ex. "XCurrency"), so that it sorts alphabetically, but no difference.
Had anybody come accross this issue before.
regards
G RaiHi,
This seems strange that the variable does not show in the query properties. One thing I can suggest it to try changing the technical name/desciption of the variable if that changes the order.
Please update back the thread if that helps. -
In selection screen i want all the item no related to s.o. no.
Hi,
i want to display all d possible entries in the second selection fields i.e. posnr related to given sales order no...means in selection screen i hav 2 parameter...sales order no and line item no.
i want all the possible no of entries for line item no (POSNR) values to b displayed when m giving the sales order no...(VBELN)...
i want the answer urgently.
regards....
AmayikaHi,
Can u be more specific.
Do u want the line items to be copied when a particular sales order is selected from F4 ? If it is so then in FM F4IF_INT_TABLE_VALUE_REQUEST we can get the values of the other fields related to the selected field and then use FM DYNP_VALUES_UPDATE.
or Do u want to display only those line items that exists for the sales order entered then first of all u have to capture the value of the sales order entered, for this there is a FM DYNP_VALUES_READ. Now u can get the line items related to this from VBAP table.
Regards,
Shafi -
How excise invoices are sorted in Excise invoice selection screen (J1ij)
Sir
when I do excise invoice creation in Ji1j for customer depatch, in the excise invoice selection screen , the excise invoices are not sorted properly, i.e excise invoice related to 2011 appearing first and then 2008 is appearing then again 2011 is appearing.
can some one tell me how these excise invoices are sorted?
Jaya AnandSir
Not yet. Already 'EI proc' is set as First in firstout only.
But Still , 2008 document is appearing in the middle of 2011 documents. i.e first 4 documents is related to 2011 and 5th document is 2008 and then again 6th document related to 2011 ect...
Can I attach the screen shot in this forum?
Regards
Jaya Anand
Edited by: Jayaanand on Nov 21, 2011 10:19 AM -
Hide an item on the selection screen
Hi Gurus!
I have a selection screen with material number on it whose refernec is use din my program for it. I would like to just hide the material selection on the selection screen but let it be on the report as its been used in the program . Is theer a ways I can hide it in my select options itself rahther than going into the elemnet list and making it invisible . Because I made it invisible through element list but when I trasported to QAT it dosent seem to work , or maybe not getting transported . So is there a way I can just hide it in my sleect options .
ThanksHi,
HIDE : s_matnr.
This is used in interactive reporting not for hiding selection screen fields!
For your requirement you have two solutions:
1) create a variant on selection screen (what you have probably already done) hiding your screen field. To see the changes in QUA system, you have to transport this variant there and use it when running the program.
2) adjusting your code to hide this select-option field in PBO of the screen by default
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if screen-name CS 'S_MATNR'.
screen-invisible = 'X'.
modify screen.
endif.
ENDLOOP.
First solution together with [transaction variants|http://help.sap.com/saphelp_47x200/helpdata/en/7d/f639f8015111d396480000e82de14a/frameset.htm] gives great flexibility to adjust system according to specific user requirement, the latter, however provides very easy (and commonly used) way to adjust selection screen from ABAP program itself.
Regards
Marcin -
Choose one item in selection screen
hallow i doing a selection screen and i wont that in field c_course u can <b>mark</b> just <b>one course</b>.(when u do f4 in c_course u have catalog of lot of courses )
becouse i have a problem that if u choose more then one course the program is run to alv but not bring any data .how can change this maybe in popup(with warnning) or disabled this option but i dont now how .
thanks
this my declertion
SELECT-OPTIONS c_course FOR z_course_table-objid with no intervals no-extension
REFRESH: c_course.
CLEAR: c_course.
PERFORM get_objid USING 'D'
CHANGING c_course-low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR c_course-high.
*======================================================
REFRESH: c_course.
CLEAR: c_course.
PERFORM get_objid USING 'D'
CHANGING c_course-high.
FORM get_objid
USING p_otype
CHANGING p_c_course.
*p_so_orgeh_low
CALL FUNCTION 'RH_OBJID_REQUEST'
EXPORTING
plvar = '01'
otype = p_otype
seark = '*'
seark_begda = so_date-low
seark_endda = so_date-high
set_mode = 'X'
DYNPRO_REPID = ' '
DYNPRO_DYNNR = ' '
DYNPRO_PLVARFIELD = ' '
DYNPRO_OTYPEFIELD = ' '
DYNPRO_SEARKFIELD = ' '
CALLBACK_PROG = ' '
CALLBACK_FORM = ' '
RESTRICT_FB = ' '
RESTRICT_DATA = ' '
WITHOUT_RSIGN =
WITHOUT_RELAT =
WITHOUT_SCLAS =
ORGBEG = SY-DATUM
ORGEND = SY-DATUM
WIN_TITLE =
APP_DATA =
IMPORTING
sel_plvar = wa_plvar
sel_otype = wa_otype
sel_object = wa_objid
TABLES
OTYPE_TABLE =
CONDITION =
BASE_OBJECTS =
MARKED_OBJECTS =
sel_objects = itab_object
SEL_HROBJECT_TAB =
SEL_HRSOBID_TAB =
EXCEPTIONS
cancelled = 1
wrong_condition = 2
nothing_found = 3
internal_error = 4
illegal_mode = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF wa_otype = 'D' .
OR wa_otype = 'DC' OR wa_otype = 'L'.
REFRESH: c_course.
CLEAR: c_course.
LOOP AT itab_object.
CLEAR c_course.
c_course-low = itab_object-objid.
c_course-option = 'EQ'.
c_course-sign = 'I'.
APPEND c_course.
ENDLOOP.
CLEAR: itab_object.
REFRESH: itab_object.
ENDIF.HI Antonio,
make the SET_MODE = ' ' or comment the value.
SET_MODE = 'X' for multiple selection.
then u can choose only 1 course at a time.
Regards
CNU -
Some items of selection-screen not showing after migration to QA
Hi Folks,
I'm trying to help a colleague with something rather weird:
After migrating code-changes from our DEV- to our QA-environment (SAP_BASIS 620, SAP_APPL 470), a newly added block of the selection-screen doesn't show up. We already spent quite some time debugging and tracing in both DEV and QA but cannot really spot a difference. The new block (B2) and field (S_DATE) show up in the selection-screen internal table SCREEN and the content looks to be identical. In addition to the complete block B2 missing, the frame-title for B3 has also gone AWOL.
This is happening for a rather straighforward selection-screen definition:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETERS : p_eaddr LIKE somlreci1-receiver OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t27.
SELECT-OPTIONS :
s_date FOR hrp1001-endda NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t23.
PARAMETERS : p_tstrun AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b3.
During debugging I already single stepped through programs like RSDBRUNT, SAPLSVAR and RSDBSPBL but nothing jumped out at me which could explain the difference between development and QA.
Do you have an idea where (else) we could look?
Thanks much and Cheers
BaerbelHi Vikranth!
Thanks for your quick reply and suggestion which I immediately followed and - guess what? - it worked! The selection-screen now looks like it should.
As we never before had this type of issue it never occurred to us to just regenerate the program in QA - next time we'll know and first try this simple fix.
Thanks again!
Cheers
Baerbel -
How to put a value in a selection screen parameter
how do i forcefully put a value to a field in the selection screen.
i mean during runtime.
and it's a parameter not a selection-option.
thanksHi,
Check this sample code.It can help you.Basically you need to use 'DYNP_VALUES_READ' in at selection-screen on value-request for s_posnr-low.
tables : vbap. " Sales Document: Item Data
Constant Declaration *
CONSTANTS:
C_X TYPE C VALUE 'X'. " Translate to Uppercase
Variable Declaration *
Variable for Table index
data v_sytabix like sy-tabix.
Variable for Program name
data L_NAME LIKE SYST-REPID.
Range for getting values form selection screen
DATA: BEGIN OF range1 OCCURS 0,
SIGN(1),
OPTION(2),
LOW LIKE vbap-vbeln,
high like vbap-vbeln,
END OF range1.
Internal table for Report output
data: begin of i_vbap occurs 0,
vbeln like vbap-vbeln, " Sales Document
posnr like vbap-posnr, " Sales Document item
end of i_vbap.
Internal table for output to the F4 help
data: begin of I_DISPLAY occurs 0,
vbeln like vbap-vbeln, " Sales Document
posnr like vbap-posnr, " Sales Document item
end of I_DISPLAY.
Internal table for return value form function module
DATA: BEGIN OF I_RETURNVAL OCCURS 0.
INCLUDE STRUCTURE DDSHRETVAL. " Interface Structure Search
DATA: END OF I_RETURNVAL.
Internal table for F4 help field heading
DATA: I_FIELDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.
Internal table for getting screen values from selection screen
data L_SCR_FIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME title text-001.
select-options:
S_VBELN for vbap-vbeln no intervals,
S_POSNR for vbap-posnr no intervals.
SELECTION-SCREEN end OF BLOCK B1.
at selection-screen on value-request for s_posnr-low.
clear: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
refresh: L_SCR_FIELDS, I_FIELDTAB, i_display, I_RETURNVAL.
L_NAME = SYST-REPID.
MOVE 'S_VBELN-LOW' TO L_SCR_FIELDS-FIELDNAME.
APPEND L_SCR_FIELDS.
Call the Function module DYNP_VALUES_READ to get the values form
selection screen
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = L_NAME
DYNUMB = SYST-DYNNR
TRANSLATE_TO_UPPER = C_X " X
TABLES
DYNPFIELDS = L_SCR_FIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
IF SY-SUBRC eq 0.
LOOP AT L_SCR_FIELDS.
range1-sign = 'I'.
range1-option = 'EQ'.
range1-low = L_SCR_FIELDS-FIELDVALUE.
range1-high = space.
append range1.
ENDLOOP.
ENDIF.
F4 help Field headings
I_FIELDTAB-TABNAME = 'I_DISPLAY'.
I_FIELDTAB-FIELDNAME = 'VBELN'.
I_FIELDTAB-POSITION = '1'.
I_FIELDTAB-OUTPUTLEN = '10'.
I_FIELDTAB-INTTYPE = 'C'.
I_FIELDTAB-INTLEN = '10'.
APPEND I_FIELDTAB.
I_FIELDTAB-FIELDNAME = 'POSNR'.
I_FIELDTAB-POSITION = '2'.
I_FIELDTAB-OFFSET = '10'.
I_FIELDTAB-OUTPUTLEN = '6'.
I_FIELDTAB-INTTYPE = 'N'.
I_FIELDTAB-INTLEN = '6'.
APPEND I_FIELDTAB.
Retrieve sales document, Sales document item from table Sales
Document: Item Data(VBAP).
Primary keys used for selection: VBELN
select vbeln posnr from vbap
into table i_display
where vbeln in range1.
Call the function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'POSNR'
WINDOW_TITLE = 'Line Item'
VALUE_ORG = 'S'
MULTIPLE_CHOICE = C_X " (for muliple selection)
TABLES
VALUE_TAB = I_DISPLAY
FIELD_TAB = I_FIELDTAB
RETURN_TAB = I_RETURNVAL
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.
Star for For single values
READ TABLE I_RETURNVAL INDEX 1.
S_POSNR-LOW = I_RETURNVAL-FIELDVAL.
End for the single values
Start For multiple selection
loop at i_returnval.
s_posnr-sign = 'I'.
s_posnr-option = 'EQ'.
s_posnr-low = I_RETURNVAL-FIELDVAL.
append s_posnr.
endloop.
sort s_posnr.
read table s_posnr index 1.
End for multiple selection
ENDIF.
Start-of-selection *
start-of-selection.
Retrieve sales document, Sales document item from table Sales
Document: Item Data(VBAP).
Primary keys used for selection: VBELN
select vbeln posnr from vbap
into table i_vbap
where vbeln in s_vbeln
and posnr in s_posnr.
if the above selection is successful continue the process else exit *
form the report
if sy-subrc ne 0.
message e002 with 'No data to display'.
endif.
end-of-selection.
if not i_vbap[] is initial.
loop at i_vbap.
write:/ i_vbap-vbeln, i_vbap-posnr.
endloop.
endif. -
Output not coming right, if we give LIFNR in selection screen
Hi,
i have LIFNR in selection screen, when i execute my report without inserting value in it...output is proper coming, but when i insert value in LIFNR, report doesn't display any data...
please check my code and guide me...
TABLES : bsik,bkpf,bseg,j_1imovend,lfa1,t001,t005u,bsak,ekko,bsis, ekkn, anla, anlc.
TYPE-POOLS : slis.
DATA : BEGIN OF itab OCCURS 0,
belnr LIKE bsik-belnr, "Document number
buzei LIKE bseg-buzei, "line item
hkont LIKE bseg-hkont, "Gl account
mwskz LIKE bseg-mwskz, "Tax Code
dmbtr LIKE bseg-dmbtr, "Amount
ebeln LIKE bseg-ebeln, "Purchasing Document
ebelp LIKE bseg-ebelp, "line item nbr
hwbas TYPE i,
shkzg LIKE bseg-shkzg, "Debit/Credit code
wrbtr LIKE bseg-wrbtr,
gjahr LIKE bsik-gjahr, "Fiscal Year
bldat LIKE bsik-bldat, "Document Date
budat LIKE bsik-budat, "Posting Date
lifnr LIKE bsik-lifnr, "Vendor number
xblnr LIKE mkpf-xblnr, "Ven invoice nbr
name1(25), "name1
ort01 LIKE lfa1-ort01, "City
j_1ilstno LIKE j_1imovend-j_1ilstno, " Vendor tin nbr
regio LIKE lfa1-regio, "Region Code
bezei LIKE t005u-bezei, "Region desc
bland LIKE t005u-bland,
tax TYPE p DECIMALS 2,
matkl LIKE ekpo-matkl,
END OF itab.
DATA : x TYPE bseg-lifnr,
y TYPE j_1imovend-j_1ilstno,
z TYPE bseg-mwskz,
a TYPE bseg-hwbas,
b TYPE t005u-bezei.
DATA:
v_bldat TYPE bldat,
v_budat TYPE budat,
v_gjahr TYPE gjahr,
v_lifnr TYPE lifnr,
v_name1 TYPE name1,
v_j_1ilstno TYPE j_1ilstno,
v_bezei TYPE bezei,
v_ebeln TYPE ebeln,
v_mwskz TYPE mwskz,
v_dmbtr TYPE dmbtr,
v_hwbas TYPE hwbas,
v_xblnr TYPE xblnr,
v_buzei TYPE buzei,
v_wrbtr TYPE wrbtr,
v_matkl TYPE matkl,
v_tax TYPE i,
v_regio TYPE regio,
v_hkont TYPE hkont.
DATA : BEGIN OF itab1 OCCURS 0.
INCLUDE STRUCTURE itab.
DATA:END OF itab1.
DATA : BEGIN OF itab2 OCCURS 0.
INCLUDE STRUCTURE itab.
DATA : END OF itab2.
DATA : itab3 LIKE STANDARD TABLE OF itab2 WITH HEADER LINE.
***********************************Purchase order history
DATA: BEGIN OF bet OCCURS 50.
INCLUDE STRUCTURE ekbe.
DATA: END OF bet.
DATA: BEGIN OF bzt OCCURS 50.
INCLUDE STRUCTURE ekbz.
DATA: END OF bzt.
DATA: BEGIN OF betz OCCURS 50.
INCLUDE STRUCTURE ekbez.
DATA: END OF betz.
DATA: BEGIN OF bets OCCURS 50.
INCLUDE STRUCTURE ekbes.
DATA: END OF bets.
DATA: BEGIN OF xekbnk OCCURS 10.
INCLUDE STRUCTURE ekbnk.
DATA: END OF xekbnk.
DATA : w_container TYPE scrfname VALUE 'CL_GRID',
w_cprog TYPE lvc_s_layo,
g_repid LIKE sy-repid,
w_save TYPE c,
w_exit TYPE c,
cl_grid TYPE REF TO cl_gui_alv_grid,
cl_custom_container TYPE REF TO cl_gui_custom_container,
it_fld_catalog TYPE slis_t_fieldcat_alv,
wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
layout TYPE slis_layout_alv,
col_pos LIKE sy-cucol ,
alvfc TYPE slis_t_fieldcat_alv.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : hkont FOR bsis-hkont ."OBLIGATORY.
SELECT-OPTIONS : lifnr FOR bsik-lifnr ."OBLIGATORY.
*PARAMETERS : lifnr for bsik-lifnr.
SELECT-OPTIONS : belnr FOR bsik-belnr .
SELECT-OPTIONS : gjahr FOR bsik-gjahr .
SELECT-OPTIONS : bldat FOR bsik-bldat.
SELECT-OPTIONS : budat FOR bsik-budat.
SELECTION-SCREEN : END OF BLOCK b1.
PERFORM fill_catalog1 USING:
'HKONT' 'ITAB2' 'G/L',
'BELNR' 'ITAB2' 'Document Number',
'BLDAT' 'ITAB2' 'Doc. date' ,
'BUDAT' 'ITAB2' 'Posting Date',
'LIFNR' 'ITAB2' 'Vendor',
'NAME1' 'ITAB2' 'Name',
'J_1ILSTNO' 'ITAB2' 'TIN No.',
'BEZEI' 'ITAB2' 'Region',
'MATKL' 'ITAB2' 'Material Group',
'EBELN' 'ITAB2' 'Purchasing Document',
'MWSKZ' 'ITAB2' 'Tax Code',
'HWBAS' 'ITAB2' 'Base Amount',
'DMBTR' 'ITAB2' 'Tax Amount',
'TAX' 'ITAB2' 'Tax Rate',
'XBLNR' 'ITAB2' 'Vendor Inv. No.'.
SELECT DISTINCT hkont belnr gjahr bldat budat INTO CORRESPONDING FIELDS OF TABLE itab
FROM bsis
WHERE bukrs = '1000'
AND hkont IN hkont
AND belnr IN belnr
AND gjahr IN gjahr
AND bldat IN bldat
AND budat IN budat
AND blart <> 'JV'.
SORT itab BY belnr.
LOOP AT itab.
SELECT * FROM bseg WHERE belnr = itab-belnr AND gjahr = itab-gjahr AND bukrs = '1000' AND ( ebeln <> ' ' OR hkont IN hkont ).
IF sy-subrc = 0.
itab-buzei = bseg-buzei.
itab-mwskz = bseg-mwskz.
IF bseg-ebeln <> ' '.
itab-ebeln = bseg-ebeln.
itab-ebelp = bseg-ebelp.
MODIFY itab.
ENDIF.
IF bseg-hkont = itab-hkont.
itab-shkzg = bseg-shkzg.
itab-hwbas = bseg-hwbas.
itab-dmbtr = bseg-dmbtr.
IF itab-hwbas NE '0'.
itab-tax = itab-dmbtr / itab-hwbas * 100.
MODIFY itab INDEX sy-tabix TRANSPORTING tax.
ENDIF.
IF itab-shkzg = 'H'.
itab-dmbtr = itab-dmbtr * ( -1 ).
ENDIF.
MOVE-CORRESPONDING itab TO itab2.
APPEND itab2.
ENDIF.
ENDIF.
ENDSELECT.
ENDLOOP.
LOOP AT itab2.
SELECT SINGLE * FROM ekko WHERE ebeln = itab2-ebeln .
IF sy-subrc = 0.
itab2-lifnr = ekko-lifnr.
ENDIF.
CALL FUNCTION 'ME_READ_HISTORY'
EXPORTING
ebeln = itab2-ebeln
ebelp = itab2-ebelp
webre = 'X'
TABLES
xekbe = bet
xekbz = bzt
xekbes = bets
xekbez = betz
xekbnk = xekbnk.
itab2-xblnr = bet-xblnr.
SELECT SINGLE * FROM lfa1 WHERE lifnr = itab2-lifnr.
itab2-name1 = lfa1-name1.
itab2-ort01 = lfa1-ort01.
itab2-regio = lfa1-regio.
SELECT SINGLE * FROM t005u WHERE bland = itab2-regio
AND spras = 'EN'
AND land1 = 'IN'.
itab2-bezei = t005u-bezei.
SELECT SINGLE * FROM j_1imovend WHERE lifnr = itab2-lifnr.
IF sy-subrc = 0 .
itab2-j_1ilstno = j_1imovend-j_1ilstno. " Vendor tin nbr
ENDIF.
MODIFY itab2.
ENDLOOP.
SORT itab2 BY belnr.
LOOP AT itab2.
v_dmbtr = v_dmbtr + itab2-dmbtr.
v_hwbas = v_hwbas + itab2-hwbas.
v_bldat = itab2-bldat.
v_budat = itab2-budat.
v_gjahr = itab2-gjahr.
v_lifnr = itab2-lifnr.
v_name1 = itab2-name1.
v_j_1ilstno = itab2-j_1ilstno.
v_bezei = itab2-bezei.
v_ebeln = itab2-ebeln.
v_mwskz = itab2-mwskz.
v_xblnr = itab2-xblnr.
v_buzei = itab2-buzei.
v_wrbtr = itab2-wrbtr.
v_matkl = itab2-matkl.
v_tax = itab2-tax.
v_regio = itab2-regio.
v_hkont = itab2-hkont.
AT END OF belnr.
itab2-bldat = v_bldat.
itab2-budat = v_budat.
itab2-gjahr = v_gjahr.
itab2-lifnr = v_lifnr.
itab2-name1 = v_name1.
itab2-j_1ilstno = v_j_1ilstno.
itab2-bezei = v_bezei.
itab2-ebeln = v_ebeln.
itab2-mwskz = v_mwskz.
itab2-dmbtr = v_dmbtr.
itab2-hwbas = v_hwbas.
itab2-xblnr = v_xblnr.
itab2-buzei = v_buzei.
itab2-wrbtr = v_wrbtr.
itab2-matkl = v_matkl.
itab2-tax = v_tax.
itab2-regio = v_regio.
itab2-hkont = v_hkont.
APPEND itab2 TO itab3.
CLEAR: itab2, v_dmbtr, v_hwbas, v_bldat, v_budat, v_gjahr, v_lifnr, v_name1, v_j_1ilstno, v_ebeln,
v_mwskz, v_xblnr, v_buzei, v_wrbtr, v_matkl, v_tax, v_regio, v_hkont.
ENDAT.
ENDLOOP.
LOOP AT itab3.
IF itab3-lifnr = ' '.
SELECT SINGLE lifnr FROM bseg INTO x WHERE belnr = itab3-belnr AND gjahr = itab3-gjahr AND bukrs = '1000' AND koart = 'K'." AND lifnr IN lifnr.
IF sy-subrc = 0.
itab3-lifnr = x .
SELECT SINGLE * FROM lfa1 WHERE lifnr = itab3-lifnr.
itab3-name1 = lfa1-name1.
itab3-ort01 = lfa1-ort01.
itab3-regio = lfa1-regio.
MODIFY itab3.
ENDIF.
ENDIF.
SELECT SINGLE bezei FROM t005u INTO itab3-bezei WHERE bland = itab3-regio AND spras EQ 'EN' AND land1 EQ 'IN'.
MODIFY itab3 INDEX sy-tabix TRANSPORTING bezei.
SELECT j_1ilstno FROM j_1imovend INTO y WHERE lifnr = itab3-lifnr .
itab3-j_1ilstno = y.
MODIFY itab3 INDEX sy-tabix TRANSPORTING j_1ilstno .
ENDSELECT.
SELECT mwskz FROM bseg INTO z WHERE belnr = itab3-belnr AND gjahr = itab3-gjahr AND bukrs = '1000' .
MODIFY itab3 INDEX sy-tabix TRANSPORTING mwskz .
ENDSELECT.
IF sy-subrc = 0.
itab3-mwskz = z .
MODIFY itab3.
ENDIF.
IF itab3-hwbas = ' '.
SELECT wrbtr FROM bseg INTO itab3-hwbas WHERE belnr = itab3-belnr AND gjahr = itab3-gjahr AND bukrs = '1000' AND buzei = '2'.
MODIFY itab3 INDEX sy-tabix TRANSPORTING wrbtr.
ENDSELECT.
ENDIF.
SELECT matkl FROM ekpo INTO itab3-matkl WHERE ebeln = itab3-ebeln .
MODIFY itab3 INDEX sy-tabix TRANSPORTING matkl .
ENDSELECT.
SHIFT itab3-lifnr LEFT DELETING LEADING '0'. " For Removing 0's
SHIFT itab3-hkont LEFT DELETING LEADING '0'. " For Removing 0's
MODIFY itab3.
IF itab3-hwbas NE '0'.
itab3-tax = itab3-dmbtr / itab3-hwbas * 100.
MODIFY itab3 INDEX sy-tabix TRANSPORTING tax.
ENDIF.
ENDLOOP.
layout-zebra = 'X' .
layout-colwidth_optimize(1) = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZFI_LP07'
is_layout = layout
it_fieldcat = it_fld_catalog
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = itab3
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.
*& Form FILL_CATALOG1
text
-->P_FIELDNAME text
-->P_REF_TABLE text
-->P_SCRTEXT text
FORM fill_catalog1 USING p_fieldname TYPE any
p_ref_table TYPE any
p_scrtext TYPE any.
CLEAR : wa_fld_catalog.
wa_fld_catalog-fieldname = p_fieldname.
wa_fld_catalog-tabname = p_ref_table.
wa_fld_catalog-seltext_s = p_scrtext.
wa_fld_catalog-seltext_m = p_scrtext.
wa_fld_catalog-seltext_l = p_scrtext.
wa_fld_catalog-datatype = 'CURR'.
wa_fld_catalog-outputlen = 20.
APPEND wa_fld_catalog TO it_fld_catalog.
ENDFORM. " fill_catalog1.
ThanksHi Anil,
check for the availability of records for values entered in selection screen lifnr..
select single lifnr
into wa_lifnr
from lfa1
where lifnr in s_lifnr.
check sy-subrc.
Regards,
Mdi.Deeba -
Report should executed based on the radio buttons on the selection screen
Hi everyone,
Greets....................
My scenario is I have 2 selection screen blocks on same screen..
One selection screen block contains input parameters as follows
Company Code - S_BUKRS
Business Area - S_GSBER
Customer Code - S_KUNNR
Fiscal Area - S_GJAHR
GL Account - S_HKONT
Posting Date -S_ZFBDT
Ledger Type -P_RLDNR
Open Item Key Date - P_ZFBDT
Another selection screen block contains 2 radio buttons with the option as follows
Collection Plan
*Credit days summary.
If i click Collection plan the report output should come based on the input parameters in first selection-screen block.
If i click Credit days summary the report output should come based on the input parameters in first selection-screen block.
Pls send me the sample code for this.
Thanks in Advance
Regards
Raj kumarSee the below folling example : it will have radio buttons and depends on radio button it will show output.
REPORT ZPPR_BOM_INFOL_REPORT no standard page heading
line-size 160
line-count 60.
======================================================================
Program Name : ZPPR_BOM_INFOL_REPORT
Description : This Program would be used for BOM List for a material*
and the component's where used list *
Author : Seshu *
Date : 07/24/2006 *
MODIFICATION HISTORY *
DATE | AUTHOR | CHANGE # | DESCRIPTION OF MODIFICATION *
|----
|----
|----
*12/04/06 | Seshu | DEVK921821 | Removed new page for each material *
======================================================================
Table definition *
TABLES: mast,
stko,
stpo,
T418,
makt.
TYPE - POOLS
TYPE-POOLS: slis.
Constants
constants : c_tcode(4) type c value 'CS03',
gc_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE'.
Variables
data : v_maktx like makt-maktx,
wa_stko like stko.
DATA:
Objekttyp 'Material'
otyp_mat(1) TYPE c VALUE '1',
ootyp_mat(1) TYPE c VALUE 'M',
Objekttyp 'kein Objekt'
otyp_noo(1) TYPE c VALUE '2',
Objekttyp 'Dokument'
otyp_doc(1) TYPE c VALUE '3',
Objekttyp 'Klasse'
otyp_kla(1) TYPE c VALUE '4',
Objekttyp 'Intramaterial'
otyp_ntm(1) TYPE c VALUE '5'.
maximal anzeigbare Menge
data: max_num(7) TYPE p DECIMALS 3 VALUE '9999999999.999',
ueberl_kz(1) TYPE c VALUE '*',
min_num(7) TYPE p DECIMALS 3 VALUE '9999999999.999-',
b_flag(1) TYPE c VALUE 'X',
ecfld(250) TYPE c,
v_flag type c.
ALV Variables
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv,
gs_keyinfo TYPE slis_keyinfo_alv,
gt_sp_group TYPE slis_t_sp_group_alv,
gt_events TYPE slis_t_event.
DATA: g_repid LIKE sy-repid.
DATA: gt_list_top_of_page TYPE slis_t_listheader,
g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname,
g_save(1) TYPE c,
gx_variant LIKE disvariant,
g_variant LIKE disvariant,
g_default(1) TYPE c,
g_exit(1) TYPE c.
Includes *
INCLUDE .
Internal Table Declaration *
DATA: t_mast LIKE STANDARD TABLE OF mast WITH HEADER LINE.
*DATA: t_makt LIKE STANDARD TABLE OF makt WITH HEADER LINE.
BOM Function module Related
DATA: t_matcat LIKE cscmat OCCURS 0 WITH HEADER LINE.
Internal Table for Level by Level Function module
DATA: t_stb LIKE stpox OCCURS 0 WITH HEADER LINE.
Get the Relevant data from FM
DATA: BEGIN OF hd_tab OCCURS 0,
stufe LIKE stpox-stufe,
vwegx LIKE stpox-vwegx,
END OF hd_tab.
Final Output
DATA: BEGIN OF alv_stb OCCURS 0.
INCLUDE STRUCTURE stpox_alv.
DATA: info(3) TYPE c,
END OF alv_stb.
DATA: BEGIN OF stb_orig.
INCLUDE STRUCTURE stpox.
DATA: END OF stb_orig.
DATA: BEGIN OF stb_add.
INCLUDE STRUCTURE stpol_add.
DATA: END OF stb_add.
Internal Table for STPO
*-- BOM Line item
TYPES: BEGIN OF ty_stpo,
stlty TYPE stpo-stlty,
stlnr TYPE stpo-stlnr,
stlkn TYPE stpo-stlkn,
stpoz TYPE stpo-stpoz,
idnrk TYPE stpo-idnrk,
meins TYPE stpo-meins,
menge TYPE stpo-menge, "Component Qty
END OF ty_stpo.
DATA: t_stpo TYPE STANDARD TABLE OF ty_stpo WITH HEADER LINE.
*-- BOM Header
TYPES: BEGIN OF ty_stko,
stlty TYPE stko-stlty,
stlnr TYPE stko-stlnr,
stlal TYPE stko-stlal,
stkoz TYPE stko-stkoz,
bmein TYPE stko-bmein,
bmeng TYPE stko-bmeng,
END OF ty_stko.
DATA: t_stko TYPE STANDARD TABLE OF ty_stko WITH HEADER LINE .
data : t_makt like makt occurs 0 with header line.
DATA: BEGIN OF cl_clstab OCCURS 0, "YHG079407
class LIKE klah-class, "YHG079407
klart LIKE klah-klart, "YHG079407
chked LIKE csdata-xfeld, "YHG079407
noobj LIKE csdata-xfeld, "YHG079407
dsply LIKE csdata-xfeld, "YHG079407
END OF cl_clstab.
*-- Header table
TYPES: BEGIN OF ty_main_material,
matnr TYPE mast-matnr, "Material
werks TYPE mast-werks, "Plant
maktx TYPE makt-maktx, "Description
stlal TYPE mast-stlal, "Alternative BOM
stlnr TYPE stko-stlnr, "BOM Number
bmein TYPE stko-bmein, "UOM
bmeng TYPE stko-bmeng, "Base Qty
expand(1) TYPE c, "Expanding Field
END OF ty_main_material.
DATA: t_main_material TYPE STANDARD TABLE OF ty_main_material WITH
HEADER LINE.
*-- Item (Component) Table
TYPES: BEGIN OF ty_item_material,
matnr TYPE mast-matnr, "Material
werks TYPE mast-werks, "Plant
idnrk TYPE stpo-idnrk, "Component (Material)
maktx TYPE makt-maktx, "Description
stlal TYPE mast-stlal, "Alternative BOM
stlnr TYPE stpo-stlnr, "BOM Number
meins TYPE stpo-meins, "UOM
menge TYPE stpo-menge, "Base Qty
END OF ty_item_material.
DATA: t_item_material TYPE STANDARD TABLE OF ty_item_material WITH
HEADER LINE.
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_werks LIKE marc-werks DEFAULT '1000' OBLIGATORY.
SELECT-OPTIONS s_stlal FOR mast-stlal .
SELECT-OPTIONS s_stlan FOR mast-stlan DEFAULT '1'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP.
PARAMETERS: p_bomlst RADIOBUTTON GROUP g1 DEFAULT 'X'.
SELECT-OPTIONS s_matnr FOR mast-matnr.
SELECTION-SCREEN SKIP.
PARAMETERS: p_compon RADIOBUTTON GROUP g1.
SELECT-OPTIONS: s_idnrk FOR stpo-idnrk.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK b1.
selection-screen begin of block b03 with frame title text-b03.
selection-screen begin of line.
selection-screen comment 1(40) text-005.
parameters: p_all radiobutton group r1 default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(40) text-006.
parameters: p_one radiobutton group r1 .
selection-screen end of line.
selection-screen end of block b03.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK b3.
At slection screen events *
*-- Process on value request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
Intitialisation
INITIALIZATION.
g_repid = sy-repid.
g_tabname_header = 'T_MAIN_MATERIAL'.
g_tabname_item = 'T_ITEM_MATERIAL'.
*-- define keyinformation
CLEAR gs_keyinfo.
gs_keyinfo-header01 = 'MATNR'.
gs_keyinfo-item01 = 'MATNR'.
PERFORM e03_eventtab_build USING gt_events[].
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM e07_sp_group_build USING gt_sp_group[].
PERFORM e08_layout_build USING gs_layout.
Set Options: save variants userspecific or general
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.
S T A R T - O F - S E L E C T I O N *******************
start-of-selection.
if p_all = 'X'.
Get the data from MAST and MAKT Table
if p_bomlst = 'X'.
Get the data Based On Material #
perform get_data.
else.
Get the data Based On Component
perform get_data_component.
endif.
else.
Get the Single Level Report
*-- Moved the fiedl catalog here inorder to change the layout based on
*-- Selection
PERFORM e01_fieldcat_init USING gt_fieldcat[].
PERFORM select_data.
endif.
E N D - O F - S E L E C T I O N *******************
end-of-selection.
if p_one = 'X'.
perform alv.
endif.
User Command
at line-selection.
Interactive to CS03 Transaction
case sy-ucomm.
when 'PICK' or 'F2'.
if not alv_stb-idnrk is initial .
if not alv_stb-werks is initial.
if not alv_stb-objty is initial.
SET PARAMETER ID 'MAT' FIELD alv_stb-idnrk.
SET PARAMETER ID 'WRK' FIELD alv_stb-werks.
SET PARAMETER ID 'CSV' FIELD alv_stb-OBJTY.
call transaction c_tcode and skip first screen.
endif.
endif.
endif.
clear alv_stb.
endcase.
*& Form get_data
Get data from MAST and MAKT Table
FORM get_data.
data : wa_lines type sy-index.
REFRESH : T_MAST,
t_STB,
t_MATCAT,
alv_STB.
CLEAR : T_MAST,
t_STB,
t_MATCAT,
alv_STB.
Get the data from MAST Table
Get all the information from MAST - BOM Table
SELECT * FROM mast INTO TABLE t_mast WHERE matnr IN s_matnr AND
werks = p_werks AND
stlan IN s_stlan AND
stlal IN s_stlal.
describe table t_mast lines wa_lines.
if wa_lines is initial.
Write:/2 'List contains no data'.
stop.
endif.
loop at t_mast.
clear : v_maktx.
Start of change Seshu
Reason - Remove the new page option
if sy-tabix ne 1.
skip 1.
endif.
End of Change Seshu
Get the material Description
select single maktx from makt into v_maktx
where matnr = t_mast-matnr
and spras = 'E'.
Get the material details from STKO Table
select single * from stko into wa_stko
where STLTY = 'M'
and STLNR = t_mast-stlnr
and STLAL = t_mast-stlal.
Main Header for Each Material
format color 5 on.
write:/2 'Material',20 'Material Description',65 'Alternative BOM',
90 'Base Qty', 115 'Base Unit'.
format color 5 off.
format color 1 on.
write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
115 wa_stko-BMEIN.
format color 1 off.
Use the Function Module and get the format level by level
perform get_level_level.
endloop.
ENDFORM. " get_data
Top of page *
top-of-page.
perform report_header .
*& Form report_header
text
--> p1 text
<-- p2 text
FORM report_header.
new-page line-size 160 .
format color col_heading intensified on.
write:/ sy-uline(160) .
*--- Write Company Name.
perform calc_col_and_write using text-h00
sy-linsz.
*--- Write Report Title.
perform calc_col_and_write using sy-title
sy-linsz.
*--- Write User Id, Date / Time, Program Id, Page etc.
perform write_other_hdr_details.
write:/ sy-uline(160) .
ENDFORM. " report_header
*& Form calc_col_and_write
text
-->P_TEXT_H00 text
-->P_SY_LINSZ text
FORM calc_col_and_write USING P_TEXT
P_LINSZ.
data: col1 type i,
col2 type i,
len type i,
str type i.
str = strlen( p_text ).
col1 = ( p_linsz / 2 ) - ( str / 2 ) .
len = p_linsz - col1 - 2.
write: at /1 '|'.
write: at col1 p_text,
at sy-colno(len) space.
write at 160 '|'.
ENDFORM. " calc_col_and_write
*& Form write_other_hdr_details
text
--> p1 text
<-- p2 text
FORM write_other_hdr_details.
data: col1 type i,
col2 type i,
len type i.
col1 = 3.
write:/1 '|'.
write: at col1 'UserId : ',
sy-uname.
len = sy-linsz - 1.
write at sy-colno(len) space.
col2 = sy-linsz - 18.
write: at col2 'Date: ',
sy-datum mm/dd/yyyy.
write: at sy-linsz '|'.
write:/1 '|'.
write: at col1 'ReportId: ',
sy-repid.
write at sy-colno(len) space.
col2 = sy-linsz - 18.
write: at col2 'Page: ',
sy-pagno.
write: at sy-linsz '|'.
ENDFORM. " write_other_hdr_details
*& Form get_data_component
Get the data based on Component level
FORM get_data_component.
data wa_lines type i.
*-- Get the BOM item details
SELECT stlty stlnr stlkn stpoz idnrk meins menge
FROM stpo
INTO TABLE t_stpo
WHERE idnrk IN s_idnrk.
IF sy-subrc = 0.
CLEAR wa_lines.
DESCRIBE TABLE t_stpo LINES wa_lines.
IF wa_lines > 0.
SELECT stlty stlnr stlal stkoz bmein bmeng
FROM stko
INTO TABLE t_stko
FOR ALL ENTRIES IN t_stpo
WHERE stlnr = t_stpo-stlnr.
CLEAR wa_lines.
DELETE ADJACENT DUPLICATES FROM t_stko COMPARING ALL FIELDS.
DESCRIBE TABLE t_stko LINES wa_lines.
IF wa_lines > 0.
*-- Get the BOM item details
SELECT * FROM mast INTO TABLE t_mast FOR ALL ENTRIES IN t_stko
WHERE werks = p_werks AND
stlnr = t_stko-stlnr
and stlal in s_stlal.
ENDIF.
ENDIF.
else.
Write:/2 'List contains no data'.
stop.
endif.
loop at t_mast.
clear : v_maktx.
Start of change Seshu
Reason - Remove the new page option
if sy-tabix ne 1.
skip 1.
endif.
End of change Seshu
Get the material Description
select single maktx from makt into v_maktx
where matnr = t_mast-matnr
and spras = 'E'.
Get the material details from STKO Table
select single * from stko into wa_stko
where STLTY = 'M'
and STLNR = t_mast-stlnr
and STLAL = t_mast-stlal.
Main Header for Each Material
format color 5 on.
write:/2 'Material',20 'Material Description',65 'Alternative BOM',
90 'Base Qty', 115 'Base Unit'.
format color 5 off.
format color 1 on.
write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
115 wa_stko-BMEIN.
format color 1 off.
Use the Function Module and get the format level by level
perform get_level_level.
clear : t_mast.
endloop.
ENDFORM. " get_data_component
*& Form obj_ident
text
FORM obj_ident.
weder Mat noch Doc
CHECK: T_stb-objty NE otyp_mat,
T_stb-objty NE ootyp_mat,
T_stb-objty NE otyp_doc,
T_stb-objty NE otyp_ntm.
?T418-WA schon ok
nein
IF T_stb-postp NE t418-postp.
T418 einlesen
PERFORM t418_lesen USING T_stb-postp.
ENDIF.
PERFORM cl_clstab_maint.
?MatNr-Eingabe bei diesem PosTyp moeglich
und keine Textposition
trifft zu
IF t418-matin NE '-'
AND t418-txpos IS INITIAL.
aktuelles Objekt ist Material NLAG
T_stb-objty = '1'.
PosKurztext in ObjKurztext uebernehmen.
T_stb-ojtxp = T_stb-potx1.
MODIFY T_stb.
ELSE.
IF T_stb-objty IS INITIAL.
T_stb-objty = '2'.
MODIFY T_stb.
ENDIF.
ENDIF.
ENDFORM. " obj_ident
*& Form t418_lesen
text
-->P_T_STB_POSTP text
FORM t418_lesen USING lkl_postp LIKE stpo-postp.
T418-WA initialisieren
CLEAR:
t418.
Key angeben
t418-postp = lkl_postp.
PosTypDefinition lesen
READ TABLE t418.
ENDFORM. " t418_lesen
*& Form cl_clstab_maint
text
FORM cl_clstab_maint.
nur fuer Klassenpositionen
CHECK t_STB-OBJTY EQ OTYP_KLA.
Teilkey der Klassenpositionentabelle
CL_CLSTAB-CLASS = t_STB-CLASS.
CL_CLSTAB-KLART = t_STB-KLART.
Klassenpositionentabelle lesen
READ TABLE CL_CLSTAB
WITH KEY CL_CLSTAB(21)
BINARY SEARCH.
aktuelle Klassenposition bereits in Klassenpositionentabelle
nein
IF SY-SUBRC <> 0.
Klassenposition in Klassenpositionentabelle hinzufuegen
INSERT CL_CLSTAB INDEX SY-TABIX.
ENDIF.
ENDFORM. " cl_clstab_maint
*& Form alv_stb_prep
Printing the data as LEVEL BY LEVEL
FORM alv_stb_prep.
CLEAR:
alv_stb,
stb_orig,
stb_add.
IF t_stb-hdnfo IS INITIAL.
stb_orig = t_stb.
IF t_stb-mngko >= max_num.
stb_add-ovfls = ueberl_kz.
ELSE.
IF t_stb-mngko <= min_num.
stb_add-ovfls = ueberl_kz.
ELSE.
CLEAR: stb_add-ovfls.
ENDIF.
ENDIF.
IF NOT t_stb-xtlnr IS INITIAL.
stb_add-bomfl = b_flag.
ENDIF.
IF NOT t_stb-knobj IS INITIAL
OR NOT t_stb-class IS INITIAL
OR NOT t_stb-kzclb IS INITIAL.
stb_add-knofl = 'X'.
ENDIF.
ELSE.
CHECK t_stb-stufe > 1.
alv_stb-info = 'C30'.
IF t_stb-ttidx <> t_matcat-index.
READ TABLE t_matcat INDEX t_stb-ttidx.
ENDIF.
stb_orig-hdnfo = t_stb-hdnfo.
stb_orig-stufe = t_stb-stufe - 1 .
stb_orig-ojtxp = t_stb-ojtxb.
IF NOT t_stb-altst IS INITIAL.
stb_orig-stlal = t_stb-stlal.
IF stb_orig-stlal(1) EQ '0'.
stb_orig-stlal(1) = ' '.
ENDIF.
ENDIF.
stb_orig-idnrk = t_matcat-matnr.
ENDIF.
CLEAR:
stb_add-dobjt,
stb_add-objic.
CASE t_stb-objty.
WHEN otyp_mat.
WRITE: stb_orig-idnrk TO ecfld.
stb_add-objic = '@A6@'.
WHEN 'M'.
WRITE: stb_orig-idnrk TO ecfld.
stb_add-objic = '@A6@'.
WHEN otyp_noo.
WRITE: stb_orig-potx1 TO ecfld.
stb_add-objic = '@0Q@'.
WHEN otyp_doc.
write stb_orig-doknr to ecfld. "note 489354
IF ecfld CP '*# '. ENDIF. "note 489354
sy-fdpos = sy-fdpos + 1. "note 489354
CONCATENATE
*d stb_orig-doknr "note 489354
stb_orig-dokar
stb_orig-doktl
stb_orig-dokvr
*d INTO ecfld "note 489354
INTO ecfld+sy-fdpos "note 489354
SEPARATED BY space.
stb_add-objic = '@AR@'.
WHEN otyp_kla.
CONCATENATE
stb_orig-class
stb_orig-klart
INTO ecfld
SEPARATED BY space.
stb_add-objic = '@7C@'.
WHEN otyp_ntm.
WRITE: stb_orig-intrm TO ecfld.
WHEN OTHERS.
ENDCASE.
*d CONDENSE ecfld. "note 515408
stb_add-dobjt = ecfld(40).
CLEAR: ecfld.
WRITE stb_orig-stufe TO stb_add-dstuf NO-SIGN.
*d MOVE-CORRESPONDING stb_orig TO alv_stb. "note 331962
MOVE-CORRESPONDING stb_add TO alv_stb.
MOVE-CORRESPONDING stb_orig TO alv_stb. "note 331962
APPEND alv_stb.
ENDFORM. " alv_stb_prep
*& Form get_level_level
text
FORM get_level_level.
REFRESH : T_STB,
T_MATCAT,
ALV_STB.
CLEAR : T_STB,
T_MATCAT,
ALV_STB.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mktls = 'X'
mehrs = 'X'
mtnrv = t_mast-matnr
stlal = '01'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = p_werks
vrsvo = 'X'
TABLES
stb = t_stb
matcat = t_matcat
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR: hd_tab.
Entry der KlassenstatusTab. initialisieren
cl_clstab,
Entry 'Objekte von Klassen' initialisieren
cl_objmemo.
REFRESH: hd_tab.
SORT t_matcat BY index ASCENDING.
Get the All levels
loop at t_stb.
IF NOT t_stb-hdnfo IS INITIAL.
EXIT.
ENDIF.
Object Identification
PERFORM obj_ident.
READ TABLE hd_tab
WITH KEY stufe = t_stb-stufe
vwegx = t_stb-vwegx
BINARY SEARCH
TRANSPORTING NO FIELDS.
?gibt es diesen Satz schon
nein
IF sy-subrc <> 0.
dann in SFP-Infosatzverweistab. aufnehmen
*d APPEND HD_TAB. "HGH054648
hd_tab-stufe = t_stb-stufe.
"HGH054648
hd_tab-vwegx = t_stb-vwegx.
"HGH054648
INSERT hd_tab "HGH054648
INTO hd_tab "HGH054648
INDEX sy-tabix. "HGH054648
PosNr initialisieren
CLEAR: t_stb-posnr.
SFP-InfosatzKz setzen
t_stb-hdnfo = 'X'.
stb-objty = otyp_mat.
"HGE246532
als SFP-Infosatz in die STB aufnehmen
append t_stb.
ENDIF.
*del ENDIF.
clear t_stb.
endloop.
SORT t_stb ASCENDING BY stufe
index ASCENDING
*del POSNR ASCENDING. "HGC062735
posnr ASCENDING "HGC062735
hdnfo DESCENDING.
LOOP AT t_stb.
T_stb-index = sy-tabix.
MODIFY T_stb.
PERFORM alv_stb_prep.
ENDLOOP.
Displays the Value as Level by Level
loop at ALV_stb.
if sy-tabix = 1.
format color 3 on.
write:/2 'Level',12 'Item',22 'Component',
42 'Material Description',82 'Base Qty',
107 'Base Unit',120 'Assembly Indicator'.
format color 3 on.
endif.
if alv_stb-MEINs is initial.
v_flag = 'X'.
endif.
if v_flag = 'X'.
format color 5 on.
write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP.
format color 1 off.
else.
if alv_stb-STUFE = '1'.
format color 1 on.
write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs, 120 alv_stb-bomfl .
format color 1 off.
elseif alv_stb-STUFE = '2'.
format color 2 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl.
format color 2 off.
elseif alv_stb-STUFE = '3'.
format color 3 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 3 off.
elseif alv_stb-STUFE = '4'.
format color 4 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 4 off.
elseif alv_stb-STUFE = '5'.
format color 5 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 5 off.
elseif alv_stb-STUFE = '6'.
format color 7 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl.
format color 6 off.
elseif alv_stb-STUFE = '7'.
format color 7 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 7 off.
else.
format color 1 on.
write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
42 alv_stb-OJTXP,72 alv_stb-mngko,
107 alv_stb-MEINs,120 alv_stb-bomfl .
format color 1 off.
endif.
endif.
hide: alv_stb.
clear : alv_stb.
clear v_flag.
endloop.
ENDFORM. " get_level_level
*& Form f4_for_variant
text
FORM f4_for_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
i_tabname_header = g_tabname_header
i_tabname_item = g_tabname_item
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. " f4_for_variant
FORM E03_EVENTTAB_BUILD *
--> E03_LT_EVENTS *
FORM e03_eventtab_build USING e03_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = e03_lt_events.
READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO e03_lt_events.
ENDIF.
ENDFORM.
FORM E04_COMMENT_BUILD *
--> E04_LT_TOP_OF_PAGE -
Customer statement line item sorting
Hello SAP Gurus,
We use a customer statement which has SAP delivered program and 'z'type form, but our requirement is to sort the line items inside the statement.
I tried using o7s6 - Line item Corresponding sort variant (SPRO>F/A>F/A Global Settings-->Correspondence)in that how would I create a sorting variant that will sort line items based on due date.
And also I believe some configuration need to be done in variant for program i.e., SE38--> give the program name and execute (F8) --> in side this there are options to sorting by due date but I was not able to achieve what I want.
Can anyone please help me with this.
Thanks
Kishore
Message was edited by:
kishoreHello
follow the link and you could get more info
http://help.sap.com/saphelp_erp2005vp/helpdata/en/01/a9c1cb455711d182b40000e829fbfe/frameset.htm
Editing Line Items
You can edit line items for a payment or an exception list at a second list level. You can use the following functions to help you edit line items:
Sort
Search
Change line layout
To edit line items of a payment, double-click the desired payment line.
The system then displays the open items of this payment on another screen.
Sorting Line Items
To sort open items, choose Edit ® Sort. This brings up an additional window where you can sort the line items according to four criteria and define a sequence (see "Sorting Payments" in Editing Payments).
Searching for Line Items
To search for particular open items, choose Edit ® Find. Select a search criterion and enter the desired values or value ranges (see "Searching for Payments" in Editing Payments).
Changing the Line Layout
To change the line layout, choose Settings ® Line Layout, and select the required line layout variant. There are four variants delivered with the standard system.
The standard setting for the sort, find, change line layout, and display totals functions depends on your system configuration. You can change it in Customizing.
Maybe you are looking for
-
PASSING INTERNAL TABLE IN SMARTFORM
HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM. THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE. TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE
-
Please don't flame me as I am just trying to understand licensing, scalability, and cost of this solution. My understanding of the BIA appliance consist of Linux blades (16GB of memory), share SAN disk subsystem (GPFS configured), isolated switched
-
[solved] Template virtual function in C++
I know this isn't legal C++ due to the compiler not being able to determine how big exactly the vtable is. I'm looking for alternatives. Basically, I have an abstract base class defining the interface for a set of derived classes. One of the function
-
I copied itunes from old pc onto new macbook pro and now itunes recognises iphone but I have to sync entire library and lose all apps etc. The sync playlists etc is greyed out. what can I do?
-
Is LiveCycle Designer the appropriate tool
Hello there, I am looking for a tool to take existing PDF forms (think goverment forms) and make some subtle formatting changes, and generate new forms. I plan to use fdf files to populate the form fields when rendering the pdfs from the forms. Is Li