Check box creation
Hi Experts,
i hae to create a check box for account assaignment default value ticked, ifit is ticked out put should come other wise output should not come
could any one help me, account assaignment field is ekpo-knttp.
i am giving the code below
REPORT zmmr_po_spendreport NO STANDARD PAGE HEADING
MESSAGE-ID zs.
Program ID : *
Version : 1.0 *
SAP Version : R/3 System Ver. 4.6C *
Program Name : ZMMR_PO_SPENDREPORT *
Created by : Venu Goli *
Created on : 6/1/2007 *
Description : A Report on Direct and Indirect spend to find out *
the lead time in PO and Invoice creation *
Tables
TABLES: ekko, "Purchasing Document Header
ekpo, "Purchasing Document Item
rbkp. "Document Header: Invoice Receipt
Type-Pools
TYPE-POOLS : slis. " Has to be declared to use ALVs
To hold ALV field catgory data
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat.
Internal tables declarations
Internal table to hold Report data
DATA: BEGIN OF it_output OCCURS 0,
dir_indir(9),
bukrs LIKE ekko-bukrs, "company code
ebeln LIKE ekko-ebeln, "Purchasing Document Number
ebelp LIKE ekpo-ebelp, "Item
aedat LIKE ekko-aedat, "Date on which the record was created
belnr LIKE rseg-belnr, "Accounting document number
bldat LIKE rbkp-bldat, "Document date in document
budat LIKE rbkp-budat, "Posting date in the document
wrbtr LIKE rseg-wrbtr, "Amount in document currency
curr LIKE t880-curr, "Price unit (Local Curr)
bednr LIKE ekpo-bednr, "Requirement tracking number
lifnr LIKE ekko-lifnr, "Vendor's account number
name1 LIKE lfa1-name1, "name1
name2(30), "preparer name
name3(30), "requester name
gjahr LIKE rseg-gjahr, "Fiscal year
ernam LIKE ekko-ernam, "Name of Person who Created the Object
kursf LIKE rbkp-kursf, "Exchange rate
shkzg LIKE rseg-shkzg, "Debit/credit indicator
banfn LIKE ekpo-banfn, "Purchase requisition number
knttp LIKE ekpo-knttp, "account assignment category
END OF it_output.
Selection Screen
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE ekko-bukrs OBLIGATORY,
kntpp AS CHECKBOX DEFAULT 'X'.
SELECT-OPTIONS: s_invdat FOR rbkp-bldat, "Document date in document
s_vendor FOR ekko-lifnr, "Vendor's account number
s_purcdo FOR ekko-ebeln, "Purchasing Document no
s_credat FOR ekko-aedat OBLIGATORY,"create date
s_plant FOR ekpo-werks, "Plant
s_doctyp FOR ekko-bsart, "Purchasing document type
s_purorg FOR ekko-ekorg, "Purchasing organization
s_trcnum FOR ekpo-bednr, "Requirement tracking number
s_knttp FOR ekpo-knttp. "account assignment category
SELECTION-SCREEN: END OF BLOCK b1.
DATA: count TYPE i VALUE 0. " Used to count records
INITIALIZATION *
INITIALIZATION.
At Selection Screen
AT SELECTION-SCREEN.
Checking for the input values of selection screen fields.
PERFORM validate_params.
Start Of Selection
START-OF-SELECTION.
PERFORM get_data.
End Of Selection
END-OF-SELECTION.
SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
PERFORM merge_fieldcatalog.
PERFORM modify_fieldcat.
PERFORM alv_report.
FORM validate_params *
FORM validate_params.
Validate company code
SELECT SINGLE COUNT(*) FROM t001 WHERE bukrs = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e021 WITH 'Please enter a valid Company code'.
ENDIF.
*Validate Vendor.
SELECT SINGLE COUNT(*) FROM lfa1 WHERE lifnr IN s_vendor.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Vendor'.
ENDCASE.
*Validate PO doc type
SELECT SINGLE COUNT(*) FROM t161 WHERE bsart IN s_doctyp.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid PO Doc. Type'.
ENDCASE.
*Validate plant
SELECT SINGLE COUNT(*) FROM t001w WHERE werks IN s_plant.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Plant. Type'.
ENDCASE.
*Validate Purch. Org
SELECT SINGLE COUNT(*) FROM t024e WHERE ekorg IN s_purorg.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Purch. Org.'.
ENDCASE.
ENDFORM. " PERFORM VALIDATE_PARAMS.
FORM get_data *
FORM get_data.
DATA: l_persnumber LIKE usr21-persnumber.
Get PO data
SELECT a~bukrs a~ebeln b~ebelp a~aedat a~lifnr a~ernam
b~knttp b~bednr b~banfn
c~belnr c~wrbtr c~gjahr c~shkzg
d~bldat d~budat d~kursf
e~dir_indir
INTO CORRESPONDING FIELDS OF TABLE it_output
FROM ekko AS a
JOIN ekpo AS b ON b~ebeln = a~ebeln
JOIN rseg AS c ON c~ebeln = b~ebeln
AND c~ebelp = b~ebelp
AND c~bukrs = a~bukrs
JOIN rbkp AS d ON d~belnr = c~belnr
AND d~gjahr = c~gjahr
LEFT JOIN zpo_dirindir AS e ON e~knttp = b~knttp
WHERE a~bukrs = p_bukrs
AND a~lifnr IN s_vendor
AND a~ebeln IN s_purcdo
AND a~bsart IN s_doctyp
AND a~ekorg IN s_purorg
AND a~aedat IN s_credat
AND b~knttp IN s_knttp
AND b~werks IN s_plant
AND b~bednr IN s_trcnum.
LOOP AT it_output.
Get posting date, Doc. date & Curr. Key
IF it_output-kursf <> 0.
it_output-wrbtr = it_output-wrbtr * it_output-kursf.
ENDIF.
get local currency
SELECT SINGLE waers INTO it_output-curr FROM t001
WHERE bukrs = it_output-bukrs.
Get vendor name.
SELECT SINGLE name1 FROM lfa1 INTO it_output-name1
WHERE lifnr = it_output-lifnr.
Get PO created person name
SELECT SINGLE persnumber INTO l_persnumber FROM usr21
WHERE bname = it_output-ernam.
IF sy-subrc = 0.
SELECT SINGLE name_text FROM adrp INTO it_output-name2
WHERE persnumber = l_persnumber.
ELSE.
it_output-name2 = it_output-ernam.
ENDIF.
Get get requested by from reciepent point in PO
else PR created by (If PR exists)
CASE it_output-dir_indir.
WHEN 'I'.
Take requested by from Reciepent point.
SELECT SINGLE wempf INTO it_output-name3 FROM ekkn
WHERE ebeln = it_output-ebeln
AND ebelp = it_output-ebelp .
WHEN 'D'.
SELECT SINGLE ernam INTO it_output-name3 FROM eban
WHERE banfn = it_output-banfn
AND ebelp = it_output-ebelp.
IF sy-subrc <> 0.
MOVE it_output-ernam TO it_output-name3.
ENDIF.
SELECT SINGLE persnumber INTO l_persnumber FROM usr21
WHERE bname = it_output-name3.
IF sy-subrc = 0.
SELECT SINGLE name_text FROM adrp INTO it_output-name3
WHERE persnumber = l_persnumber.
ENDIF.
ENDCASE.
translate direction indicator to Indirect or Direct
CASE it_output-dir_indir.
WHEN 'I'. it_output-dir_indir = 'Indirect'.
WHEN 'D'. it_output-dir_indir = 'Direct'.
ENDCASE.
MODIFY it_output.
ENDLOOP.
ENDFORM.
FORM MERGE_FIELDCATALOG *
FORM merge_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-cprog
i_internal_tabname = 'IT_OUTPUT'
i_inclname = sy-cprog
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " MERGE_FIELDCATALOG
FORM modify_fieldcat *
FORM modify_fieldcat.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
LOOP AT it_fieldcat INTO wa_fieldcat.
CASE wa_fieldcat-fieldname.
WHEN 'DIR_INDIR'.
wa_fieldcat-seltext_m = 'Direct/Indirect'.
WHEN 'NAME2'.
wa_fieldcat-seltext_m = 'PREPARER NAME'.
WHEN 'NAME3'.
wa_fieldcat-seltext_m = 'REQUESTER NAME'.
WHEN 'BEDNR'.
wa_fieldcat-seltext_m = 'SSP PO'.
WHEN 'AEDAT'.
wa_fieldcat-seltext_m = 'PO DOCUMENT DATE'.
WHEN 'BLDAT'.
wa_fieldcat-seltext_m = 'INVOICE DOCU DATE'.
WHEN 'BUDAT'.
wa_fieldcat-seltext_m = 'POSTAGE DATE'.
WHEN 'WRBTR'.
wa_fieldcat-seltext_m = 'LOCAL AMOUNT'.
wa_fieldcat-cfieldname = 'CURR'.
wa_fieldcat-ctabname = wa_fieldcat-tabname.
WHEN 'CURR'.
wa_fieldcat-seltext_m = 'LOCAL CURR'.
WHEN 'NAME1'.
wa_fieldcat-seltext_m = 'VENDOR NAME'.
ENDCASE.
MODIFY it_fieldcat FROM wa_fieldcat.
ENDLOOP.
ENDFORM.
FORM ALV_REPORT *
FORM alv_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = it_output[].
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
REPORT zmmr_po_spendreport NO STANDARD PAGE HEADING
MESSAGE-ID zs.
Program ID : *
Version : 1.0 *
SAP Version : R/3 System Ver. 4.6C *
Program Name : ZMMR_PO_SPENDREPORT *
Created by : Venu Goli *
Created on : 6/1/2007 *
Description : A Report on Direct and Indirect spend to find out *
the lead time in PO and Invoice creation *
Tables
TABLES: ekko, "Purchasing Document Header
ekpo, "Purchasing Document Item
rbkp. "Document Header: Invoice Receipt
Type-Pools
TYPE-POOLS : slis. " Has to be declared to use ALVs
To hold ALV field catgory data
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat.
Internal tables declarations
Internal table to hold Report data
DATA: BEGIN OF it_output OCCURS 0,
dir_indir(9),
bukrs LIKE ekko-bukrs, "company code
ebeln LIKE ekko-ebeln, "Purchasing Document Number
ebelp LIKE ekpo-ebelp, "Item
aedat LIKE ekko-aedat, "Date on which the record was created
belnr LIKE rseg-belnr, "Accounting document number
bldat LIKE rbkp-bldat, "Document date in document
budat LIKE rbkp-budat, "Posting date in the document
wrbtr LIKE rseg-wrbtr, "Amount in document currency
curr LIKE t880-curr, "Price unit (Local Curr)
bednr LIKE ekpo-bednr, "Requirement tracking number
lifnr LIKE ekko-lifnr, "Vendor's account number
name1 LIKE lfa1-name1, "name1
name2(30), "preparer name
name3(30), "requester name
gjahr LIKE rseg-gjahr, "Fiscal year
ernam LIKE ekko-ernam, "Name of Person who Created the Object
kursf LIKE rbkp-kursf, "Exchange rate
shkzg LIKE rseg-shkzg, "Debit/credit indicator
banfn LIKE ekpo-banfn, "Purchase requisition number
knttp LIKE ekpo-knttp, "account assignment category
END OF it_output.
Selection Screen
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE ekko-bukrs OBLIGATORY,
kntpp AS CHECKBOX DEFAULT 'X'.
SELECT-OPTIONS: s_invdat FOR rbkp-bldat, "Document date in document
s_vendor FOR ekko-lifnr, "Vendor's account number
s_purcdo FOR ekko-ebeln, "Purchasing Document no
s_credat FOR ekko-aedat OBLIGATORY,"create date
s_plant FOR ekpo-werks, "Plant
s_doctyp FOR ekko-bsart, "Purchasing document type
s_purorg FOR ekko-ekorg, "Purchasing organization
s_trcnum FOR ekpo-bednr, "Requirement tracking number
s_knttp FOR ekpo-knttp. "account assignment category
parameters : p_knntp as checkbox default 'X'.
SELECTION-SCREEN: END OF BLOCK b1.
DATA: count TYPE i VALUE 0. " Used to count records
INITIALIZATION *
INITIALIZATION.
At Selection Screen
AT SELECTION-SCREEN.
Checking for the input values of selection screen fields.
PERFORM validate_params.
Start Of Selection
START-OF-SELECTION.
if p_knttp = 'X'.
PERFORM get_data.
else.
message 'no output'.
endif.
End Of Selection
END-OF-SELECTION.
SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
PERFORM merge_fieldcatalog.
PERFORM modify_fieldcat.
PERFORM alv_report.
FORM validate_params *
FORM validate_params.
Validate company code
SELECT SINGLE COUNT(*) FROM t001 WHERE bukrs = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e021 WITH 'Please enter a valid Company code'.
ENDIF.
*Validate Vendor.
SELECT SINGLE COUNT(*) FROM lfa1 WHERE lifnr IN s_vendor.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Vendor'.
ENDCASE.
*Validate PO doc type
SELECT SINGLE COUNT(*) FROM t161 WHERE bsart IN s_doctyp.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid PO Doc. Type'.
ENDCASE.
*Validate plant
SELECT SINGLE COUNT(*) FROM t001w WHERE werks IN s_plant.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Plant. Type'.
ENDCASE.
*Validate Purch. Org
SELECT SINGLE COUNT(*) FROM t024e WHERE ekorg IN s_purorg.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
MESSAGE e021 WITH 'Please enter a valid Purch. Org.'.
ENDCASE.
ENDFORM. " PERFORM VALIDATE_PARAMS.
FORM get_data *
FORM get_data.
DATA: l_persnumber LIKE usr21-persnumber.
Get PO data
SELECT a~bukrs a~ebeln b~ebelp a~aedat a~lifnr a~ernam
b~knttp b~bednr b~banfn
c~belnr c~wrbtr c~gjahr c~shkzg
d~bldat d~budat d~kursf
e~dir_indir
INTO CORRESPONDING FIELDS OF TABLE it_output
FROM ekko AS a
JOIN ekpo AS b ON b~ebeln = a~ebeln
JOIN rseg AS c ON c~ebeln = b~ebeln
AND c~ebelp = b~ebelp
AND c~bukrs = a~bukrs
JOIN rbkp AS d ON d~belnr = c~belnr
AND d~gjahr = c~gjahr
LEFT JOIN zpo_dirindir AS e ON e~knttp = b~knttp
WHERE a~bukrs = p_bukrs
AND a~lifnr IN s_vendor
AND a~ebeln IN s_purcdo
AND a~bsart IN s_doctyp
AND a~ekorg IN s_purorg
AND a~aedat IN s_credat
AND b~knttp IN s_knttp
AND b~werks IN s_plant
AND b~bednr IN s_trcnum.
LOOP AT it_output.
Get posting date, Doc. date & Curr. Key
IF it_output-kursf <> 0.
it_output-wrbtr = it_output-wrbtr * it_output-kursf.
ENDIF.
get local currency
SELECT SINGLE waers INTO it_output-curr FROM t001
WHERE bukrs = it_output-bukrs.
Get vendor name.
SELECT SINGLE name1 FROM lfa1 INTO it_output-name1
WHERE lifnr = it_output-lifnr.
Get PO created person name
SELECT SINGLE persnumber INTO l_persnumber FROM usr21
WHERE bname = it_output-ernam.
IF sy-subrc = 0.
SELECT SINGLE name_text FROM adrp INTO it_output-name2
WHERE persnumber = l_persnumber.
ELSE.
it_output-name2 = it_output-ernam.
ENDIF.
Get get requested by from reciepent point in PO
else PR created by (If PR exists)
CASE it_output-dir_indir.
WHEN 'I'.
Take requested by from Reciepent point.
SELECT SINGLE wempf INTO it_output-name3 FROM ekkn
WHERE ebeln = it_output-ebeln
AND ebelp = it_output-ebelp .
WHEN 'D'.
SELECT SINGLE ernam INTO it_output-name3 FROM eban
WHERE banfn = it_output-banfn
AND ebelp = it_output-ebelp.
IF sy-subrc <> 0.
MOVE it_output-ernam TO it_output-name3.
ENDIF.
SELECT SINGLE persnumber INTO l_persnumber FROM usr21
WHERE bname = it_output-name3.
IF sy-subrc = 0.
SELECT SINGLE name_text FROM adrp INTO it_output-name3
WHERE persnumber = l_persnumber.
ENDIF.
ENDCASE.
translate direction indicator to Indirect or Direct
CASE it_output-dir_indir.
WHEN 'I'. it_output-dir_indir = 'Indirect'.
WHEN 'D'. it_output-dir_indir = 'Direct'.
ENDCASE.
MODIFY it_output.
ENDLOOP.
ENDFORM.
FORM MERGE_FIELDCATALOG *
FORM merge_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-cprog
i_internal_tabname = 'IT_OUTPUT'
i_inclname = sy-cprog
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
ENDFORM. " MERGE_FIELDCATALOG
FORM modify_fieldcat *
FORM modify_fieldcat.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
LOOP AT it_fieldcat INTO wa_fieldcat.
CASE wa_fieldcat-fieldname.
WHEN 'DIR_INDIR'.
wa_fieldcat-seltext_m = 'Direct/Indirect'.
WHEN 'NAME2'.
wa_fieldcat-seltext_m = 'PREPARER NAME'.
WHEN 'NAME3'.
wa_fieldcat-seltext_m = 'REQUESTER NAME'.
WHEN 'BEDNR'.
wa_fieldcat-seltext_m = 'SSP PO'.
WHEN 'AEDAT'.
wa_fieldcat-seltext_m = 'PO DOCUMENT DATE'.
WHEN 'BLDAT'.
wa_fieldcat-seltext_m = 'INVOICE DOCU DATE'.
WHEN 'BUDAT'.
wa_fieldcat-seltext_m = 'POSTAGE DATE'.
WHEN 'WRBTR'.
wa_fieldcat-seltext_m = 'LOCAL AMOUNT'.
wa_fieldcat-cfieldname = 'CURR'.
wa_fieldcat-ctabname = wa_fieldcat-tabname.
WHEN 'CURR'.
wa_fieldcat-seltext_m = 'LOCAL CURR'.
WHEN 'NAME1'.
wa_fieldcat-seltext_m = 'VENDOR NAME'.
ENDCASE.
MODIFY it_fieldcat FROM wa_fieldcat.
ENDLOOP.
ENDFORM.
FORM ALV_REPORT *
FORM alv_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = it_output[].
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Similar Messages
-
Need code for Dynamic check box creation in struts
dynamic checkbox should be created with details of data stored in database(with check mark for already selected check box).
once user make any change to that page and click submit the result ahould be saved in database..
can anybody explain me how to proceed this.
If any sample source code you have plz do sent me..consider these are the details in database
1. apple checked
2. orange
3. mango
4. grapes checked
consider a jsp page which should display list of fruits in the datsbase,
the jsp page should retrieve these data and diaplay with check box.
These should be generated dynamically.
Assume the jsp page has option for user to enter some other fruit name which should be updated into database of fruits and that should be displayed with the jsp page during next visit.(i.e) number of fruits in the database is not constant. -
Dynamic check box creation in selection screen
Hello,
I am trying to put up some check boxes dynamically in a selection screen. The number: of check boxes required and the 'checkbox label text' is to be retrieved from a database table. I have retrieved all these values in AT SELECTION-SCREEN OUTPUT event. But, I dont know how to create check box parameters using these dynamic values. Please help..hi Giffin,
Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
Z_13317_DYN_CHKBOX will take an integer as an input. After giving input, click on the button on selection screen.
Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
REPORT Z_13317_DYN_CHKBOX.
types :begin of t_itab1,
line(72),
end of t_itab1.
data: incl type table of t_itab1 with header line.
parameters: p_tab type i,
p_frst type c no-display.
selection-screen begin of line.
selection-screen: pushbutton 2(20) but1 user-command cli1.
selection-screen end of line.
include z_13317_dyn_incl if found.
initialization.
at selection-screen output.
if p_frst = ' '.
p_frst = 'X'.
perform crt_dyn_incl.
endif.
at selection-screen.
case sy-ucomm.
when 'CLI1'.
perform crt_dyn_incl.
endcase.
*& Form crt_dyn_incl
* text
form crt_dyn_incl .
perform populate_incl.
perform del_incl.
insert report 'Z_13317_DYN_INCL' from incl.
commit work.
submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
endform. " crt_dyn_incl
*& Form del_incl
* text
form del_incl .
call function 'RS_DELETE_PROGRAM'
exporting
program = 'Z_13317_DYN_INCL'
suppress_checks = 'X'
suppress_popup = 'X'
with_cua = ' '
with_documentation = ' '
with_dynpro = 'X'
with_includes = ' '
with_textpool = ' '
with_variants = ' '
if sy-subrc <> 0.
endif.
endform. " del_incl
*& Form populate_incl
* text
form populate_incl .
data: v_cnt type n.
do p_tab times.
v_cnt = v_cnt + 1.
incl-line = 'parameters: '.
concatenate incl-line 'p_chk' v_cnt into incl-line.
concatenate incl-line 'as checkbox.' into incl-line separated by space.
append incl.
clear incl.
enddo.
endform. " populate_incl
Regards,
Sailaja. -
Check box creation(urgent)
hi experts i have to crate check box for ekko-knttp(when blank enties also we need to get data) could any oone help me
PARAMETERS: P_FIELD TYPE ekko-knttp AS CHECKBOX.
-
Event to use for Creation of a Check box on Warehouse master Form
Hi experts
I have created one check box on Warehouse Master form in AfterMENUClick Event. It works fine if I open the form on Menuclick . But If I open the Warehouse master form by Link button from any document, it does not show the check box. I also want to deactive the checkbox if once it checked. So, I do some coding in Data_Load event. It also works fine If I open the form by Menu click. But if I open the form by Link button it gives error " Invalid Item Id ".
So I want to know which event I should use to create the check box and which Event I Should use to Deactive the Check boxThanks Nagy for quick reply
I use the following code for creation of check box
<B1Listener(BoEventTypes.et_FORM_LOAD, False, New String() {"62"})> _
Public Overridable Sub OnAfterFormLoad(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
'ADD YOUR ACTION CODE HERE ...
Dim oForm As Form
Dim oMatrix As Matrix
Dim oItem As Item
Dim sysItem As Item
Dim BinCheck As CheckBox
Dim BinLabel As StaticText
Dim cmbBinCode As ComboBox
oForm = B1Connections.theAppl.Forms.ActiveForm
oForm.PaneLevel = 1
sysItem = oForm.Items.Item("2000002010") 'Excisable check box
oItem = oForm.Items.Add("BinChk", BoFormItemTypes.it_CHECK_BOX)
oItem.Left = sysItem.Left
oItem.Top = sysItem.Top + 20
BinCheck = oItem.Specific
BinCheck.Caption = "Bin Enabled"
BinCheck.DataBind.SetBound(True, "OWHS", "U_BinEnabled")
End Sub
It gives error on sysItem = oForm.Items.Item("2000002010") line Invalid Item Id
Plz check and tell the problem
Regards
Gorge -
R12: New Instance creation: what is create warranty check box?
Hello all,
In R12, we can create Item instance from Contract launchpad screen itself.
When New Instance sub form opens, it has "create warranty" check box.
What is the purpose of this checkbox?
Regards
PreetiYes,you can create so that you can cover this instance in the same contract quickly ( i am hoping it is not automatically adding to the contract where you created from). This must be keeping in mind the customer service getting calls about new product that customer wanted to get covered.
Warranty creation depends on whether the product (item) has BOM with warranty item as a component or not. Do you have that setup done for this item?
Thanks
Nagamohan -
Creation of check boxes in the ALV report
Hi All,
With all your support i'm gaining more knowledge, thank's for that,
in my ALV report i want to create a check boxes if the check boxs are elected and processed then the particular records is going to disappear,
How can we do this,
Thanks & Regards
Krishnahi,
i have done this one.please check my code.
TYPE-POOLS : slis.
TYPES : BEGIN OF st_ekko,
ebeln TYPE ekko-ebeln, "Purchasing Document Number
bstyp TYPE ekko-bstyp, "Purchasing Document Category
bsart TYPE ekko-bsart, "Purchasing Document Type
aedat TYPE ekko-aedat, "record created on
ernam TYPE ekko-ernam, "Person who Created the Object
check(1),
END OF st_ekko.
TYPES : BEGIN OF st_ekpo,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp, "Item Number of Purchasing Document
ematn TYPE ekpo-ematn, "Material number
matkl TYPE ekpo-matkl, "Material group
netpr TYPE ekpo-netpr, "Net price in purchasing document
END OF st_ekpo.
TYPES : BEGIN OF st_ebeln,
ebeln TYPE ekpo-ebeln,
END OF st_ebeln.
TYPES : BEGIN OF st_eine,
ebeln TYPE ekko-ebeln,
ekorg TYPE eine-ekorg,
ekgrp TYPE eine-ekgrp,
END OF st_eine.
TYPES : BEGIN OF st_check,
check(1),
END OF st_check.
DATA : it_ekpo TYPE STANDARD TABLE OF st_ekpo,
it_ekko TYPE STANDARD TABLE OF st_ekko,
wa_ekko LIKE LINE OF it_ekko,
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
wa_layout TYPE slis_layout_alv,
it_events TYPE slis_t_event,
st_event LIKE LINE OF it_events,
it_listheadr TYPE slis_t_listheader ,
wa_listheadr LIKE LINE OF it_listheadr,
st_printparams TYPE slis_print_alv,
it_sortinfo TYPE slis_t_sortinfo_alv,
wa_sortinfo LIKE LINE OF it_sortinfo,
it_ekposortinfo TYPE slis_t_sortinfo_alv,
wa_ekposortinfo LIKE LINE OF it_ekposortinfo,
it_filter TYPE slis_t_filter_alv,
it_ebeln TYPE STANDARD TABLE OF st_ebeln,
it_eine TYPE STANDARD TABLE OF st_eine,
wa_eine TYPE st_eine,
it_popup TYPE STANDARD TABLE OF st_eine,
wa_popup TYPE st_eine,
it_check TYPE STANDARD TABLE OF st_check,
wa_check TYPE st_check.
DATA : v_ebeln TYPE ekko-ebeln.
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE tit.
SELECT-OPTIONS: so_ebeln FOR v_ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b.
INITIALIZATION
INITIALIZATION.
tit = text-000.
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON so_ebeln.
PERFORM validate_ebeln.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_ekko_data.
PERFORM get_eine_data.
END-OF-SELECTION
END-OF-SELECTION.
PERFORM populate_fieldcat1.
PERFORM populate_layout.
PERFORM get_eventlist.
PERFORM get_ekkosortinfo.
PERFORM ekkodisplay_onalv.
*& Form POPULATE_FIELDCAT1
FORM populate_fieldcat1.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'BSTYP'.
wa_fieldcat-seltext_l = text-005.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'BSART'.
wa_fieldcat-seltext_l = text-006.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_l = text-007.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-seltext_l = text-008.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. "POPULATE_FIELDCAT1
*& Form populate_fieldcat2
FORM populate_fieldcat2 .
CLEAR wa_fieldcat.
CLEAR it_fieldcat.
REFRESH it_fieldcat.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-seltext_l = text-009.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EMATN'.
wa_fieldcat-seltext_l = text-010.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'MATKL'.
wa_fieldcat-seltext_l = text-011.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-seltext_l = text-012.
wa_fieldcat-datatype = 'CURR'. "Obligatory to perform SUM
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. "populate_fieldcat2
*& Form GET_EVENTLIST
FORM get_eventlist.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[]
EXCEPTIONS
list_type_wrong = 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.
READ TABLE it_events WITH KEY name = slis_ev_pf_status_set INTO st_event.
IF sy-subrc EQ 0.
st_event-form = 'SET_PF_STATUS1'.
APPEND st_event TO it_events.
CLEAR st_event.
ENDIF.
READ TABLE it_events WITH KEY name = slis_ev_end_of_page INTO st_event.
IF sy-subrc EQ 0.
st_event-form = 'END_OF_PAGE'.
APPEND st_event TO it_events.
CLEAR st_event.
ENDIF.
ENDFORM. "GET_EVENTLIST
*& Form ekpodisplay_onalv
FORM ekpodisplay_onalv .
IF it_ekpo[] IS INITIAL.
MESSAGE 'NO DATA FOUND' TYPE 'I'.
ELSE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'AT_USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
is_layout = wa_layout
it_fieldcat = it_fieldcat
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
it_sort = it_ekposortinfo[]
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = it_events
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_ekpo
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.
ENDIF.
ENDFORM. "ekpodisplay_onalv
*& Form SET_PF_STATUS1
FORM set_pf_status1 USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'MENU' excluding rt_extab. "Copy from SALV .
ENDFORM. "SET_PF_STATUS1
*& Form SET_PF_STATUS
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' excluding rt_extab. "Copy from SALV .
ENDFORM. "SET_PF_STATUS
*& Form AT_user_command
FORM at_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname EQ 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SELECT ebeln ebelp ematn matkl netpr
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln EQ wa_ekko-ebeln.
PERFORM populate_fieldcat2.
PERFORM populate_layout2.
PERFORM get_ekposortinfo.
PERFORM ekpodisplay_onalv.
ELSE.
MESSAGE i020(z50871msg) WITH text-013.
ENDIF.
WHEN 'SE16'.
CALL TRANSACTION 'SE16'.
WHEN 'SE37'.
CALL TRANSACTION 'SE37'.
WHEN 'DISP'.
PERFORM get_popupdata.
PERFORM get_popupfcat.
PERFORM display_popup.
ENDCASE.
ENDFORM. "AT_user_command
*& Form TOP_OF_PAGE
FORM top_of_page.
REFRESH it_listheadr.
wa_listheadr-typ = 'H'.
wa_listheadr-info = text-001.
APPEND wa_listheadr TO it_listheadr.
CLEAR wa_listheadr.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheadr[]
i_logo = 'ENJOYSAP_LOGO'. "From OAER transaction
ENDFORM. "TOP_OF_PAGE
*& Form build_print_params
FORM build_print_params.
st_printparams-reserve_lines = '3'. "Lines reserved for footer
st_printparams-no_coverpage = 'X'.
ENDFORM. "build_print_params
*& Form end_of_page
FORM end_of_page.
REFRESH it_listheadr.
wa_listheadr-typ = 'H'.
wa_listheadr-info = sy-pagno.
APPEND wa_listheadr TO it_listheadr.
CLEAR wa_listheadr.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheadr[].
ENDFORM. "end_of_page
*& Form GET_EKPOSORTINFO
FORM get_ekposortinfo.
wa_ekposortinfo-up = 'X'.
wa_ekposortinfo-spos = 1.
wa_ekposortinfo-fieldname = 'EBELP'.
wa_ekposortinfo-tabname = 'EKPO'.
APPEND wa_ekposortinfo TO it_ekposortinfo.
CLEAR wa_ekposortinfo.
wa_ekposortinfo-up = 'X'.
wa_ekposortinfo-spos = 2.
wa_ekposortinfo-fieldname = 'EMATN'.
wa_ekposortinfo-tabname = 'EKPO'.
APPEND wa_ekposortinfo TO it_ekposortinfo.
CLEAR wa_ekposortinfo.
ENDFORM. "GET_EKPOSORTINFO
*& Form POPULATE_LAYOUT
FORM populate_layout.
wa_layout-colwidth_optimize = 'X'. "column width
wa_layout-zebra = 'X'.
wa_layout-no_hline = 'X'.
wa_layout-no_vline = 'X'.
wa_layout-cell_merge = 'X'.
wa_layout-box_fieldname = 'CHECK'.
wa_layout-box_tabname = 'IT_EKKO'.
wa_layout-window_titlebar = 'PURCHASE ORDER HEADER DETAILS'.
ENDFORM. "POPULATE_LAYOUT
*& Form get_EKKOsortinfo
FORM get_ekkosortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 1.
wa_sortinfo-fieldname = 'EBELN'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 2.
wa_sortinfo-fieldname = 'BSTYP'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 3.
wa_sortinfo-fieldname = 'AEDAT'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
ENDFORM. "get_EKKOsortinfo
*& Form EKKODISPLAY_ONALV
FORM ekkodisplay_onalv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS1'
i_callback_user_command = 'AT_USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_sort = it_sortinfo[]
it_filter = it_filter
it_events = it_events[]
TABLES
t_outtab = it_ekko[]
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.
ENDFORM. "EKKODISPLAY_ONALV
*& Form validate_ebeln
FORM validate_ebeln.
SELECT ebeln
FROM ekpo
INTO TABLE it_ebeln
WHERE ebeln IN so_ebeln.
IF sy-subrc NE 0.
MESSAGE e020(z50871msg) WITH text-014.
ENDIF.
ENDFORM. "validate_ebeln
*& Form populate_layout2
FORM populate_layout2 .
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'. "column width
wa_layout-zebra = 'X'.
wa_layout-no_hline = 'X'.
wa_layout-no_vline = 'X'.
wa_layout-cell_merge = 'X'.
wa_layout-window_titlebar = 'PURCHASE ORDER DETAILS SECOND SCREEN'.
ENDFORM. " populate_layout2
*& Form GET_POPUPDATA
FORM get_popupdata .
LOOP AT it_ekko INTO wa_ekko WHERE check = 'X'.
READ TABLE it_eine INTO wa_eine WITH KEY ebeln = wa_ekko-ebeln.
IF sy-subrc NE 0.
MESSAGE i020(z50871msg) WITH text-015 wa_ekko-ebeln .
ELSE.
wa_popup-ebeln = wa_eine-ebeln.
wa_popup-ekorg = wa_eine-ekorg.
wa_popup-ekgrp = wa_eine-ekgrp.
APPEND wa_popup TO it_popup.
ENDIF.
ENDLOOP.
ENDFORM. " GET_POPUPDATA
*& Form GET_POPUPFCAT
FORM get_popupfcat .
CLEAR wa_fieldcat.
REFRESH it_fieldcat.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EKORG'.
wa_fieldcat-seltext_l = text-016.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EKGRP'.
wa_fieldcat-seltext_l = text-017.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " GET_POPUPFCAT
*& Form DISPLAY_POPUP
FORM display_popup .
LOOP AT it_ekko INTO wa_ekko WHERE check EQ 'X'.
wa_check-check = wa_ekko-check.
APPEND wa_check TO it_check.
ENDLOOP.
IF it_check[] IS INITIAL.
MESSAGE i020(z50871msg) WITH text-018.
ENDIF.
IF NOT it_popup[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = text-003
i_allow_no_selection = 'X'
i_scroll_to_sel_line = 'X'
i_tabname = 'IT_POPUP'
it_fieldcat = it_fieldcat
i_callback_program = sy-repid
TABLES
t_outtab = it_popup
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.
ENDIF.
REFRESH it_check.
REFRESH it_popup.
ENDFORM. " DISPLAY_POPUP
*& Form get_ekko_data
FORM get_ekko_data .
SELECT ebeln bstyp bsart aedat ernam
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko
WHERE ebeln IN so_ebeln.
IF sy-subrc NE 0.
MESSAGE e020(z50871msg) WITH text-019.
ENDIF.
ENDFORM. " get_ekko_data
*& Form get_eine_data
FORM get_eine_data .
SELECT ebeln ekorg ekgrp
FROM eine
INTO TABLE it_eine
WHERE ebeln IN so_ebeln.
ENDFORM. " get_eine_data
*& Form at_user_command1
FORM at_user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'SE16'.
CALL TRANSACTION 'SE16'.
WHEN 'SE37'.
CALL TRANSACTION 'SE37'.
ENDCASE.
regards,
pavan t. -
Creation of radio buttons and check boxes
Hi
This is ravi
Please help me to write the following program-
■ Design a selection screen having 5 check boxes and five radio-buttons
■ Each check box and radio button be given a number starting with one to five
■ Depending on which checkbox and radio button is selected output that number
For example if I have selected check box one and radio button two then the output should be-
check box number 1
radio button number 2Hi,
Check the following code:
SELECTION-SCREEN: BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
parameters: chk1 as checkbox,
chk2 as checkbox,
chk3 as checkbox,
chk4 as checkbox,
chk5 as checkbox,
rad1 radiobutton group grp1,
rad2 radiobutton group grp1,
rad3 radiobutton group grp1,
rad4 radiobutton group grp1,
rad5 radiobutton group grp1.
selection-screen: end of block blk.
start-of-selection.
if chk1 = 'X'.
write:/ 'You selected first checkbox'.
elseif chk2 = 'X'.
write:/ 'You selected second checkbox'.
elseif chk3 = 'X'.
write:/ 'You selected third checkbox'.
elseif chk4 = 'X'.
write:/ 'You selected fourth checkbox'.
elseif chk5 = 'X'.
write:/ 'You selected fifth checkbox'.
endif.
if rad1 = 'X'.
write:/ 'You selected first radiobutton'.
elseif rad2 = 'X'.
write:/ 'You selected second radiobutton'.
elseif rad3 = 'X'.
write:/ 'You selected third radiobutton'.
elseif rad4 = 'X'.
write:/ 'You selected fourth radiobutton'.
elseif rad5 = 'X'.
write:/ 'You selected fifth radiobutton'.
endif.
Regards,
Bhaskar -
How to print check boxes in output using alv
send me replly immediately
hi
Program Name: ALV ON SECONDARY LISTS Creation: 02/01/2007*
SAP Name : YH634_0102007_ALV_LIST Application: *
Author : P.V.D.Veeresh Babu Type: 1 *
Description : This program is used to display secondary lists using *
ALV. *
Inputs: *
Tables: *
SPFLI - Flight information *
SFLIGHT - Flight *
SBOOK - Flight booking details *
Select options: *
N/A *
Parameters: *
NO *
Outputs: secondary lists with ALV *
External Routines *
Function Modules: *
REUSE_ALV_LIST_DISPLAY *
Transactions : No *
Programs : No *
Return Codes: No *
Ammendments: *
Programmer Date Req. # Action *
================ ========== ====== ==============================*
type-pools: slis.
*" Data declarations...................................................
Data declaration of the structure to hold layout details *
data:
fs_layout type slis_layout_alv.
*" Data declarations...................................................
Data declaration of the structure to hold spfli details *
data: begin of fs_spfli,
color(4) type c, " Color
check type c. " Check box
include structure spfli. " Spfli
data end of fs_spfli.
*" Data declarations...................................................
Data declaration of the structure to hold sflight details *
data:begin of fs_sflight,
color(4) type c, " Color
check type c. " Check box
include structure sflight. " Sflight
data end of fs_sflight.
*" Data declarations...................................................
Data declaration of the structure to hold sbook details *
data:
fs_sbook like sbook.
Internal table to hold list details *
data:
t_sbook like
standard table
of fs_sbook.
Internal table to hold list details *
data:
t_sflight like
standard table
of fs_sflight .
Internal table to hold spfli details *
data:
t_spfli like
standard table
of fs_spfli.
fs_layout-box_fieldname = 'CHECK'.
fs_layout-info_fieldname = 'COLOR'.
"........Retrieving basic list data containing spfli details......."
select *
from spfli
into corresponding fields of table t_spfli.
if sy-subrc ne 0.
message text-001 type 'I'.
endif. " IF SY-SUBRC NE 0
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS1'
i_callback_user_command = 'USER_COMMAND1'
i_structure_name = 'SPFLI'
is_layout = fs_layout
tables
t_outtab = t_spfli
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
Form STATUS1 *
This subroutine gives pf-status for spfli list *
-->T_EXTAB excluding table *
form status1 using t_extab type slis_t_extab.
set pf-status 'STATUS1'.
endform. " STATUS1
Form USER_COMMAND1 *
This subroutine displays secondary list containing sflight details*
-->FS_UCOMM user command *
-->T_SELFIELD selfield *
form user_command1 using fs_ucomm type sy-ucomm
t_selfield type slis_selfield.
case fs_ucomm.
when 'SFLIGHT'.
perform display_list2.
endcase. " CASE FS_UCOMM
t_selfield-refresh = 'X'.
endform. " USER_COMMAND1
Form DISPLAY_LIST2 *
This subroutine displays sflight details on secondary list *
There are no interface parameters to be passed in this subroutine *
form display_list2 .
data lw_flag type i. " Flag
refresh t_sflight.
loop at t_spfli into fs_spfli.
if fs_spfli-check = 'X'.
"........Retrieving basic list data containing sflight details......."
select *
from sflight
appending corresponding fields of table t_sflight
where carrid eq fs_spfli-carrid
and connid eq fs_spfli-connid.
if sy-subrc eq 0.
lw_flag = 1.
endif. " IF SY-SUBRC EQ 0
FS_SPFLI-CHECK = '0'.
fs_spfli-color = 'C510'.
modify t_spfli from fs_spfli .
endif. " IF FS_SPFLI-CHECK EQ 'X'
endloop. " LOOP AT T_SPFLI INTO FS_SPFLI
if lw_flag eq 0.
message text-003 type 'E'.
endif. " IF LW_FLAG EQ 1
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS2'
i_callback_user_command = 'USER_COMMAND2'
i_structure_name = 'SFLIGHT'
is_layout = fs_layout
tables
t_outtab = t_sflight
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
endform. " DISPLAY_LIST2
Form STATUS2 *
This subroutine gives pf-status for secondary list. *
-->T_EXTAB Excluding table *
form status2 using t_extab type slis_t_extab.
set pf-status 'STATUS2'.
endform. " STATUS2
Form USER_COMMAND2 *
This subroutine gives secondary list containing sbook details *
-->FS_UCOMM user command *
-->T_SELFIELD selfield *
form user_command2 using fs_ucomm type sy-ucomm
t_selfield type slis_selfield.
case fs_ucomm.
when 'SBOOK'.
perform display_list3.
endcase. " CASE FS_UCOMM
t_selfield-refresh = 'X'.
endform. " USER_COMMAND2
Form DISPLAY_LIST3 *
This subroutine displays sbook details on secondary list *
There are no interface parameters to be passed in this subroutine *
form display_list3 .
data lw_flag type i. " Flag
refresh t_sbook.
loop at t_sflight into fs_sflight.
if fs_sflight-check eq 'X'.
"........Retrieving basic list data containing sbook details......."
select *
from sbook
appending corresponding fields of table t_sbook
where carrid eq fs_sflight-carrid
and connid eq fs_sflight-connid
and fldate eq fs_sflight-fldate.
if sy-subrc eq 0.
lw_flag = 1.
endif. " IF SY-SUBRC EQ 0
FS_SFLIGHT-CHECK = '0'.
fs_sflight-color = 'C910'.
modify t_sflight from fs_sflight.
endif. " IF FS_FLIGHT-CHECK EQ 'X'
endloop. " LOOP AT T_SFLIGHT INTO....
if lw_flag eq 0.
message text-004 type 'E'.
endif. " IF LW_FLAG EQ 1
".................Calling function module for ALV..................."
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_structure_name = 'SBOOK'
is_layout = fs_layout
tables
t_outtab = t_sbook
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message text-002 type 'I'.
endif. " IF SY-SUBRC NE 0
endform. " DISPLAY_LIST3
regards,
veeresh
null -
Hello Sir,
I am Developing One Report In ALV, But I want One Column Of ALV Should Be In Checkboxes .How Can I set Check Box In Field Catalog.
Plz Help Me.hi,
Try like this.
*& Report ZTEST_ALV
REPORT ztest_alv.
TYPE-POOLS
TYPE-POOLS: slis. " Type pool for ALV
Tables
TABLES: vbak, vbap.
INTERNAL TABLES
DATA: BEGIN OF g_t_itab OCCURS 0,
sel TYPE c,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
vbtyp LIKE vbak-vbtyp,
vkorg LIKE vbak-vkorg,
vtweg LIKE vbak-vtweg,
spart LIKE vbak-spart,
netwr LIKE vbak-netwr,
kunnr LIKE vbak-kunnr,
END OF g_t_itab.
DATA: BEGIN OF g_t_item OCCURS 0,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
arktx LIKE vbap-arktx,
END OF g_t_item.
Data fields used for ALV call - simple list
DATA : g_f_repid LIKE sy-repid.
DATA : g_t_fieldcat TYPE slis_t_fieldcat_alv.
DATA : g_r_fieldcat TYPE slis_fieldcat_alv.
DATA : g_t_events TYPE slis_t_event.
DATA : g_r_events TYPE slis_alv_event.
DATA : g_r_layout TYPE slis_layout_alv.
DATA : g_r_x_variant LIKE disvariant.
DATA : g_r_variant LIKE disvariant.
DATA : g_f_exit(1) TYPE c.
DATA : g_f_save(1) TYPE c.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
START OF SELECTION
START-OF-SELECTION.
PERFORM get_data.
END OF SELECTION
END-OF-SELECTION.
PERFORM set_alv_parameters.
PERFORM display_list.
*& Form get_data
Get data from DB tables
FORM get_data.
CLEAR: g_t_itab.
REFRESH: g_t_itab.
SELECT vbeln erdat vbtyp vkorg vtweg spart netwr kunnr
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE g_t_itab
WHERE
vbeln IN s_vbeln.
ENDFORM. " get_data
*& Form set_alv_parameters
Set alv parameters , layout, events, fieldcatlog
FORM set_alv_parameters.
PERFORM set_filedcatlog.
ENDFORM. " set_alv_parameters
*& Form display_list
text
FORM display_list.
g_f_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_f_repid
is_layout = g_r_layout
it_fieldcat = g_t_fieldcat[]
it_events = g_t_events[]
TABLES
t_outtab = g_t_itab
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.
ENDFORM. " display_list
*& Form set_filedcatlog
text
FORM set_filedcatlog.
DATA: l_r_fieldcat TYPE slis_fieldcat_alv. " For column heading
CLEAR : g_t_fieldcat,
g_t_fieldcat[].
<b> l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'SEL'.
l_r_fieldcat-checkbox = 'X'.
l_r_fieldcat-outputlen = 2.
l_r_fieldcat-col_pos = 1.
l_r_fieldcat-edit = 'X'.
l_r_fieldcat-input = 'X'.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.</b>
Sales Order
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'VBELN'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'VBELN'.
l_r_fieldcat-col_pos = 2.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Creation date
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'ERDAT'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'ERDAT'.
l_r_fieldcat-col_pos = 3.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
document category
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'VBTYP'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'VBTYP'.
l_r_fieldcat-col_pos = 4.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Sales organization
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'VKORG'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'VKORG'.
l_r_fieldcat-col_pos = 5.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Distribution channel
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'VTWEG'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'VTWEG'.
l_r_fieldcat-col_pos = 6.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Division
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'SPART'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'SPART'.
l_r_fieldcat-col_pos = 7.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Net Value
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'NETWR'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'NETWR'.
l_r_fieldcat-col_pos = 8.
l_r_fieldcat-do_sum = 'X'.
l_r_fieldcat-emphasize = 'C500'.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
Distribution channel
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-fieldname = 'KUNNR'.
l_r_fieldcat-ref_tabname = 'VBAK'.
l_r_fieldcat-ref_fieldname = 'KUNNR'.
l_r_fieldcat-col_pos = 9.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
ENDFORM. " set_filedcatlog -
FREE check box in PO should be selected by default for specific material
Hi All,
We have a check box FREE in PO creation - ME21N in the item row which is selected when ever we want the vendor to supply those items as free.
- I have a list ot items which are supplied freely by the vendor which I have to mention in the PO. My requirment is when ever the specific material is in the PO the FREE check box should be selected by default. Is it possible?
Please advice.
Thanks ,
Vengal Rao.Hi Vengal Rao,
I don't think there's such flag in the material master. As far as I know any material can be supplied either free or chargeable - the buyer has to choose the applicable option it in each specific PO.
If however in your business case certain materials shall always be supplied as free, then you can use the BAdI that I mentioned above to analyse which material is being procured and set the FREE flag in the PO accordingly.
BR
Raf -
How to activate the Check box in Purchase Order after Goods Receipt
Hi All,
How to activate the check box after Goods receipt of Purchase order in Item view (Goods Receipt is completed).
Where t make the settings in SPRO.
Regards,
Shailendra HadkarHi
SPRO - SAP IMG- Material management - Inventory management and physical inventory - Goods receipt - create purchase order automatically - activate auto Po creation for movement type.
Then activate the auto PO creation in Vendor master - Purchasing view
Check it out.
Regards,
raman -
Info record update check box in Po
Hi,
We are working in ECC 6.0 envirnmoment and our project is trying to explore the functionality of PIR. The problem is I am not able to see info record update check box in the material data tab of the PO. I did not get any configuration in SPRO to make that field visible/ invisible. Please help me to for making this field visible at the time of PO creation in transcaction code me21n.HI Muttu,
SPRO>>MM>>Purchasing >> Purchase order>>Define Screen Layout at Document Level>> NBF>> Administrative data,
in that u can make display or optional or required entry
Check once again in ur Purchase order it may be display mode in ur PO
Regards
Pramod -
Use of 'Item' Check box available in 'Additional Authorization Creator'
What is the use of the 'Item' Check box available in 'Additional
Authorization Creator' document?
B1 Help States that:
Item
Defines the object as an item rather than a form.
Permissions set to form apply to all its subordinates. Permissions set to an item do not apply to the parent form.
My requirement is as follows:
I want to restrict a particular user from accessing the 'Logistics' tab
of the Purchase order.
1. I opened the 'Additional Authorization Creator' and added the 'PO
Logistics Tab' in the description window.
2. In the Forms Ids, i have mentioned as '114' (Form Id of Logistic
Tab)
3. Now I went to the authorizations screen and in the
UserAuthorization, I selected ''PO Logistics Tab' and set this to 'No
Authorization' for user named 'Raman'.
4. When I logged inwith user 'Raman', still I could access
the 'Logistics Tab' of the PO.
Please explain me the significace of 'Item' Check box available
in 'Additional Authorization Creator' document.Hi Shridharan,
The Item option does not refer to the "items" like "fields, buttons, grids or tabs" but it refers to other forms which might have a parent form.
There is also a note which states that the authorizations for the above items vannot be created via the "additional Authorization window"
The text of the note is :
Symptom
When defining authorizations for specific item (field, button,
checkbox...) by using the Additional Authorization Creator, these
authorizations are actually not applied, and the user can work as if
these additional authorizations were not created.
Other terms
Additional Authorization Creator, Item, Field, Form
Reason and Prerequisites
FAQ
Solution
By definition, the Additional Authorization Creator is designed to
enable the creation of additional authorizations on form (window) level
only and not for item (field) level. Therefore, the additional
authorization that were created for single items have no meaning.
Note number : 1067360
Regards
Arshdeep -
Confirm end of processing check box in task
Hi,
In my workflow used fork with 2 parallel branches.
In one branch is a dialog activity step ( sending doc to incorportaors for review - checked the confirm end of processing checkbox in the task )
and in the other branch is a 'Wait for Event' step ( wait for rejection - when status getting changes to 32).
when executing dialog activity with confirm end of processing,branch 1 wait step workitem is getting completed and branch 2 workitem is logically getting deleted and further step in the workflow is not executed in branch 2.
Same changes I am trying to do without confirm end of processing pop up.When I uncheck the check box and execute the dialog activity, branch 1 wait step workitem is getting completed and branch 2 workitem is also getting completed ( instead logically getting deleted ) and further step in the workflow is executed in branch 2. I dont want the remaining step to get executed.
Please let me know how to achieve this. I tried with some function module but its not working.
In the attached file, I have shown the screenshot where it is going wrong.
Thanks & Regards,
PriyaHi Priya
Both steps (in both branches) are getting executed by the same activity by the user. Yes, it's a race as correctly mentioned by Mike
As mentioned by Prakash, either you need to restrict REJECTION event creation or you can try an approach mentioned in the following thread:
Re: TRIP Workflow approval issue
You can refer to my response in the above thread:
Dated: Feb 26, 2014 (10:25AM) and Feb 26, 2014 (12:59PM)
Regards,
Modak
Maybe you are looking for
-
Burning CD-Rs - Inconsistent Results
My iMac is inconsistent in its ability to burn CD-Rs. I can not burn two CDs in a row. If the system has been idle for several hours, I can burn a CD from iPhoto, Finder, or iTunes. However, after I burn the first CD, I can't not burn another CD. I g
-
Hi there, Can anyone clarify this issue for me? My lab told me, in order for my titles to not be pixelated in HD (specifically HD CAM SR), I would need to do the titles in 4k. The version I have of Motion can max do 2k, but Livetype allows for 4k (sp
-
Adobe InDesign CS5 Server JavaScript: Get rectangle by XML tag
Hi, Current set-up: Adobe InDesign Server CS5 scripted through ExtendScript via PHP SOAP The problem: I'm currently placing an image file into a rectangle using the following code: frame = doc.rectangles[0]; imgList = frame.place(new File(i
-
I finally received my MBP on Monday after ordering it on Jan. 28th. I drove myself crazy checking this board and decided to take a break about 2 weeks ago. The reason I am writing is to give some people a sense of comfort and security. I was very wor
-
I am moving to my MINI for DVD backups and was wondering if anyone knew were I could get a key/serial for NTI Dragonburn? I've looked all over the net and couldn't find anything, maybe I'm looking in the wrong places? I only got 2 trial DVD backups d