Layout of RadioButtons
Hi everyone,
I have done some code for a menu with a JPanel and RadioButtons but I don't know how to change the layout. I need the buttons to be in the middle of the panel and underneath each other like:
. One
. Two
. Three
Would anyone be able to show me how to do this?
Here is my code.
public class RadioButtonFrame extends JFrame{
public RadioButtonFrame ()
setTitle("RadioButtonTest");
setSize(WIDTH, HEIGHT);
Container contentPane = getContentPane();
label = new JLabel(
"Welcome to the Http Log Analyzer Program. Choose an option.");
label.setFont(new Font("Serif", Font.BOLD,
DEFAULT_SIZE));
contentPane.add(label, BorderLayout.NORTH);
buttonPanel = new JPanel();
group = new ButtonGroup();
JRadioButton button1 = new JRadioButton("Search for User Name", true);
group.add(button1);
buttonPanel.add(button1);
ActionListener listener = new ActionListener()
public void actionPerformed(ActionEvent evt)
Queries.searchForUserName();
button1.addActionListener(listener);
JRadioButton button2 = new JRadioButton("Two", false);
group.add(button2);
buttonPanel.add(button2);
ActionListener listener2 = new ActionListener()
public void actionPerformed(ActionEvent evt)
Queries.searchForFileName();
button2.addActionListener(listener2);
JRadioButton button3 = new JRadioButton("Three", false);
group.add(button3);
buttonPanel.add(button3);
ActionListener listener3 = new ActionListener()
public void actionPerformed(ActionEvent evt)
Queries.searchForDates();
button3.addActionListener(listener3);
JRadioButton button4 = new JRadioButton("Four", false);
group.add(button4);
buttonPanel.add(button4);
ActionListener listener4 = new ActionListener()
public void actionPerformed(ActionEvent evt)
Queries.searchForBytes();
button4.addActionListener(listener4);
JRadioButton button5 = new JRadioButton("Five", false);
group.add(button5);
buttonPanel.add(button5);
ActionListener listener5 = new ActionListener()
public void actionPerformed(ActionEvent evt)
Queries.searchForTransferFailures();
button5.addActionListener(listener5);
contentPane.add(buttonPanel, BorderLayout.CENTER);
public static final int WIDTH = 600;
public static final int HEIGHT = 400;
private JPanel buttonPanel;
private ButtonGroup group;
private JLabel label;
private static final int DEFAULT_SIZE = 20;
Thanks
Jonny
try the BoxLayout API or: ... ---> )
this.setLAtout(null);Sorry;-this.setLayout(null);
Similar Messages
-
Calling 2 different layout by clicking radiobutton
Hi ,
In my program there are 3 radiobutton . 1- Open item 2- Closed Item 3- Both
In all the 3 layout file format is same .
I am getting my first layout (Open). Is there is any sample program or Logic where i can get the 2nd & 3rd output by clicking the 2nd & 3rd radio button.
Pls anyone give me the sample prog or logic how to do this.
Thanks
KiroHi this is vague question.
Are you using sap script or smartForm?
Is this Finance module or SD or what? -
RadioButtons some buttons and layout
Hi,
I try several times to create a particular layout with jsf using panelgrid and selectoneradio but after a lot of attempts I need hlp please.
In practice I need to create a table where in each row there is a radio button, some text and a button image.
I try in a way like this
<h:panelGrid columns="2">
<h:selectOneRadio ... >
<f:selecitem itemLabel="..." itemValue="..."/>
</h:panelGrid>
<h:commandLink> <h:graphicImage value="/registration.jpg"/> </h:commandLink>
</h:panelGrid>
I try in many ways like add css style for vertical-align, for td height but I dont reach the goal to get and the same line radio button and text aligned with button image.
Perhaps the problem is that the selectone radio create an html radio.
Anyone has an idea?
Thanks in advanceWell if you are stuck with out of the box JSF components you will have to use the table and put the elements in columns to insure things line up.
Look at the HTML source also for clues, it will absolutely create an HTML radio and I forget exactly what HTML panelGrid is using for layout -
How to change font size in smartform and set layout of smartform
Dear abapers,
I want to change font size in smartform and also set the layout of smart form how can we do this.
Thank you sir.Hi,
you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
Thanks,
venkat -
REUSE_ALV_GRID_DISPLAY layout problem
Hi All,
I have a report which can output two different ALV grid depending upon the option selected on selection screen.
For example say I have selection screen with option button for Vendor report and Customer report. When user select Vendor report option button then content of KNA1 is displayed in ALV grid, similarly when user select Vendor report option button then content of LFA1 is displayed.
Now when I save a layout on Vendor report, that layout is also visible on Customer report and vice versa. Both of these report share same set of layouts.
Is there any method so that both of these report have there own set of layouts?
The problem which I am facing is I have save a layout on Vendor report to display column LFA1-LIFNR only and this layout is DEFAULT layout. Now when I run report for Customer report (customer option button selected) it shows me only on column KNA1-LIFNR. Actually it select the layout which is saved with Vendor report.
Is there any solution? Thanks in advance...
Vendor
Ceushii
check this out
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
PARAMETERS: LIST RADIOBUTTON GROUP G1,
GRID RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
FORM CHECK_OPTION.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
WA_EVENTS-FORM = 'TOP'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
WA_EVENTS-NAME = 'END_OF_LIST'.
WA_EVENTS-FORM = 'END_LIST'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
IF LIST = 'X'.
PERFORM LIST_DISP.
ENDIF.
IF GRID = 'X'.
PERFORM GRID_DISP.
ENDIF.
ENDFORM.
FORM CHECK_OPTION.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
WA_EVENTS-FORM = 'TOP'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
WA_EVENTS-NAME = 'END_OF_LIST'.
WA_EVENTS-FORM = 'END_LIST'.
APPEND WA_EVENTS TO IT_EVENTS.
CLEAR WA_EVENTS.
IF LIST = 'X'.
PERFORM LIST_DISP.
ENDIF.
IF GRID = 'X'.
PERFORM GRID_DISP.
ENDIF.
ENDFORM.
hope this helps
Thanks&Regards
Naresh -
Converting Smartform into PDF preview layout
Hi ABAP experts,
We have converted an existing invoice layout smart form into PDF layout in print preview mode. However, we have an issue with PDF layout alignment. Earlier, it used to print the documents correctly (layout is aligned properly at the middle of the page). But when use this 'PDF' preview layout (triggered from smart form) the layout is left aligned/ larger right margin (but not at the middle).
We have gone through the existing forum links on this PDF layout generating from smart form. But no luck on this left alignment issue. Do we need to modify the OTF data that is being populated in the layout. Can it be modifed with the position of the layout dynamically. Please advise.
Technical team has used "CONVERT_OTF_2_PDF" to populate the OTF data.
In SAP note # 323736 (issued in 2006), the below limitation was mentioned. But do we have any way to resolve this page alignment issue.
Page size for SAPscript/SmartForms: PDF conversion uses the page format from the form definition as page size for the PDF document. If this has been defined larger than the page size that is actually used (for example for INCH12, INCH11 and so on), a reduced document or a larger right margin are the
result when you view/print in Acrobat Reader.
Thanks in advance.
Regards,
SatyaHi Satya,
'We tried that option of "PDF!" but it didn't work for this smart form. Do we need to include/activate any option for this in the smart form.'..What do you mean by it didn't work for this smartform.?
Execute your smartform and when you are in the print preview mode of the form means you get the output, then type PDF! in the command and hit ENTER. A popup will get displayed if you are using windows 7
or Allow and decline type of radiobutton option will be displayed if you are using Windows XP. So just click Allow and your smartform output will be displayed in pdf. Now you can save the pdf output file while clicking the save option in PDF. Your smartform output will be aligned properly in the PDF.
You don't need any activation or any FM for converting the output in pdf for this.
Basically, we do this to attach the smartform output in test plan.
NOTE: This is for only to get the output in PDF while you are in Print preview of the form.
Regards
Syed -
How to create new field groups in AA master data screen layout?
Hello,
We are using ECC 6.0
We have created bunch of new fields for asset master data, but we want to make them visible only for particular asset class. So we need to customize in SPRO Asset Master Data Screen Layout, but there no specific field groups that we can customize. So how to create and add new field groups to manage them by radiobuttons Required, Optional, No or Display?hi,
think, it's not possible.
look here:
http://help.sap.com/saphelp_47x200/helpdata/en/4f/71e05a448011d189f00000e81ddfac/frameset.htm
"The field groups and their respective fields are defined in system tables"
kind regards
Andreas -
Layout in Dynamic Internal table
Hi All,
This is the selection screen snap-shot and based on the header radiobutton selection the corresponding value (SE11 in this case) should be the header in the output(ALV grid).
After executing then sorted some columns in the output screen and then saved the layout as '/layout'.
Again we execute the report with header selection as 'ACTVT' ie. now 01 should be the column header in the output and gave the saved layout name (/layout) in the layout field(not shown in the snap shot).
but '01' is not coming in the output.
When checked in the 'Change layout ' icon the column name(01) is there in the 'Column set' list and not in "Diaplayed column " list.
If we dont give the layout name and execute the output is coming correctly i.e 01 as header.
Is the issue is bcoz the layout of ALV get distrubed of the new columns?
if so, any other way to achieve the output with layout name entered?
Thanks in advanceHi All,
This is the selection screen snap-shot and based on the header radiobutton selection the corresponding value (SE11 in this case) should be the header in the output(ALV grid).
After executing then sorted some columns in the output screen and then saved the layout as '/layout'.
Again we execute the report with header selection as 'ACTVT' ie. now 01 should be the column header in the output and gave the saved layout name (/layout) in the layout field(not shown in the snap shot).
but '01' is not coming in the output.
When checked in the 'Change layout ' icon the column name(01) is there in the 'Column set' list and not in "Diaplayed column " list.
If we dont give the layout name and execute the output is coming correctly i.e 01 as header.
Is the issue is bcoz the layout of ALV get distrubed of the new columns?
if so, any other way to achieve the output with layout name entered?
Thanks in advance -
Change Layout in Selection Screen for OO ALV-Grid
Hello everyone,
I got a problem regarding layouts for objectoriented ALV Grid. I want to make it possible that user can take the layout for ALV he wants to on the selection screen. So far thats no problem and it works. But there are some little problems which I do not know how to fix them. But first the facts:
(1) I got my parameter for layout
PARAMETER: p_vari TYPE disvariant-variant.
(2) I fill my global layout structure in initialization
INITIALIZATION.
* Variante vorbelegen
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
* Layout holen
CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = gs_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc = 0.
p_vari = gs_variant-variant.
ENDIF.
(3) I got my handling for F4-value help on variant parameter
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
CALL FUNCTION 'LVC_VARIANT_F4'
EXPORTING
is_variant = gs_variant
i_save = 'A'
IMPORTING
es_variant = gs_variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE text-m01 TYPE 'S'.
ELSE.
p_vari = gs_variant-variant.
ENDIF.
(4) I give back my parameters content into the variant structure at start of selection
START-OF-SELECTION.
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
gs_variant-variant = p_vari.
This works all fine but I got some problems when using default variants/layouts. For example I got a default variant only for me. When starting the selection screen it works fine that the default layout was written. It is displayed automatically in the variant parameter. But I want that if i I empty the content (blank it out) from my variant parameter, that report should start with "normal" layout how it was written in the report and NOT with default layout.
When I clear the gs_variant it works like I want it, but then the alv layout button looks like (without functions for layout), because I do not have the reference to my report.
So what to do? :-)
Regards
MichaelWow that was fast, works great, thanks :-)
I did not use this parameter in set table method but now I fill it dynamically.
Ok next problem, one step harder ;-)
Now I have one selection screen for one ALV-Grid, but four radio buttons which control with which data the ALV gets filled (four different fieldcats, data tables and so on). Each Grid got an own HANDLE so that the layouts can be separated in four categories.
Now I want that by changing the radio button the individual standard layout for the chosen alv grid is getting filled.
This works fine when using it in selection screen output.
AT SELECTION-SCREEN OUTPUT.
CLEAR gs_variant.
* Layout-Handles individuell für Klausel-Radiobuttons setzen
IF p_py IS NOT INITIAL.
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
gs_variant-handle = 'KLPY'.
ELSEIF p_rh IS NOT INITIAL.
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
gs_variant-handle = 'KLRH'.
ELSEIF p_aj IS NOT INITIAL.
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
gs_variant-handle = 'KLAJ'.
ELSEIF p_sr IS NOT INITIAL.
gs_variant-username = sy-uname.
gs_variant-report = sy-repid.
gs_variant-handle = 'KLSR'.
ENDIF.
* Layout holen
CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = gs_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc = 0.
p_vari = gs_variant-variant.
ELSE.
CLEAR p_vari.
ENDIF.
But unfortunately selection screen output is getting passed by EACH changing in the selection screen. This means when I try to clear the default layout in my parameter field, it gets refilled automatically with default layout. If I do a condition around the filling (only if not initial) the default value filling does not work fine in every case, e.g. when clearing the parameters field and then change the radiobutton -> then it does not get filled automatically. -
I am developing an ALV report where I have 3 (basic, secondary 1 and secondary 2)lists.
Here can I use only one LAYOUT for all the 3 lists or I have to maintain 3 layout declarations for 3 lists. Give me one example.
Thanks for your precious time.
Regards,
K B Ramthis is an example of interactive list where I am using same layouts for the two screens I am going to display...
Check the bolded part, dont forget to mark helpful answers
REPORT Z_50657_ALV_EX5 NO STANDARD PAGE HEADING
LINE-COUNT 65(3)
LINE-SIZE 220
MESSAGE-ID ZZ.
Type Pools *
TYPE-POOLS: SLIS, ICON.
Tables *
TABLES : VBRK, "Billing Master table
VBRP. "Billing Item table
VARIABLES DECLARATION *
DATA: STR_DATE LIKE SY-DATUM.
DATA: X_FIELDCAT_VBRK TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT_VBRK TYPE SLIS_T_FIELDCAT_ALV.
DATA: X_FIELDCAT_VBRP TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT_VBRP TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: CUR_VBELN(15), CUR_VBELN_VALUE(15).
DATA: TEMP_VBELN(10).
DATA: CTAB LIKE SY-TABIX.
Internal Tables *
Internal table to hold data from VBRK
DATA: BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN,
WAERK LIKE VBRK-WAERK,
VKORG LIKE VBRK-VKORG,
FKDAT LIKE VBRK-FKDAT,
BUKRS LIKE VBRK-BUKRS,
BUTXT LIKE T001-BUTXT,
CHECK(1) TYPE C,
END OF IT_VBRK.
Internal table to hold data from VBRP
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN LIKE VBRP-VBELN,
POSNR LIKE VBRP-POSNR,
FKIMG LIKE VBRP-FKIMG,
VRKME LIKE VBRP-VRKME,
NETWR LIKE VBRP-NETWR,
MATNR LIKE VBRP-MATNR,
ARKTX LIKE VBRP-ARKTX,
END OF IT_VBRP.
DATA: BEGIN OF IT_T001 OCCURS 0,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
END OF IT_T001.
Selection-Screen *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
S_FKDAT FOR VBRK-FKDAT,
S_MATNR FOR VBRP-MATNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
PARAMETERS : LIST RADIOBUTTON GROUP G1,
GRID RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
INITIALIZATION ********************
INITIALIZATION.
STR_DATE = SY-DATUM - 200.
S_FKDAT-LOW = STR_DATE.
S_FKDAT-HIGH = SY-DATUM.
S_FKDAT-SIGN = 'I'.
APPEND S_FKDAT.
At Selection-Screen Output *
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_FKDAT-HIGH'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
At Selection-Screen *
AT SELECTION-SCREEN.
PERFORM VALIDATION.
Start of Selection *
START-OF-SELECTION.
*POPULATION OF DATA INTO INTERNAL TABLE IT_VBRK AND IT_VBRP
PERFORM GET_DATA_VBRK.
PERFORM FIELDCATALOG_CHANGE.
*ALV GRID/LIST DISPLAY
PERFORM FIRST_SCREEN_DISPLAY.
*& Form VALIDATION
text
FORM VALIDATION.
IF S_VBELN[] IS NOT INITIAL.
SELECT SINGLE VBELN
FROM VBRK
INTO VBRK-VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'PLEASE ENTER CORRECT BILLING DOCUMENT'.
STOP.
ENDIF.
ENDIF.
IF S_FKDAT[] IS INITIAL.
MESSAGE I000 WITH 'PLEASE ENTER ALL THE MANDATORY FIELDS'.
STOP.
ENDIF.
IF S_MATNR[] IS NOT INITIAL.
SELECT SINGLE MATNR
FROM MARA
INTO VBRP-MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'PLEASE ENTER CORRECT MATERIAL NUMBER'.
STOP.
ENDIF.
ENDIF.
ENDFORM. "VALIDATION
*& Form GET_DATA_VBRK
text
FORM GET_DATA_VBRK.
SELECT VBELN
WAERK
VKORG
FKDAT
BUKRS
FROM VBRK INTO TABLE IT_VBRK
WHERE VBELN IN S_VBELN
AND FKDAT IN S_FKDAT.
SORT IT_VBRK BY VBELN BUKRS.
SELECT BUKRS
BUTXT
FROM T001 INTO TABLE IT_T001
FOR ALL ENTRIES IN IT_VBRK
WHERE BUKRS = IT_VBRK-BUKRS.
LOOP AT IT_VBRK.
CTAB = SY-TABIX.
LOOP AT IT_T001 WHERE BUKRS = IT_VBRK-BUKRS.
IF SY-SUBRC = 0.
IT_VBRK-BUTXT = IT_T001-BUTXT.
MODIFY IT_VBRK INDEX CTAB.
CLEAR CTAB.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. "GET_DATA
*& Form FIELDCATALOG_CHANGE
text
FORM FIELDCATALOG_CHANGE.
*Layout Change
<b> L_LAYOUT-ZEBRA = 'X'.</b>
L_LAYOUT-BOX_FIELDNAME = 'CHECK'.
*Define seperate Color for the fields
X_FIELDCAT_VBRK-COL_POS = 1.
X_FIELDCAT_VBRK-FIELDNAME = 'CHECK'.
X_FIELDCAT_VBRK-SELTEXT_M = 'chek'.
X_FIELDCAT_VBRK-CHECKBOX = 'X'.
X_FIELDCAT_VBRK-INPUT = 'X'.
X_FIELDCAT_VBRK-EDIT = 'X'.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-COL_POS = 2.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'VBELN'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C301'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'WAERK'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C201'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'VKORG'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C300'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'FKDAT'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C600'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'BUKRS'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C400'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
X_FIELDCAT_VBRK-TABNAME = 'IT_VBRK'.
X_FIELDCAT_VBRK-FIELDNAME = 'BUTXT'.
X_FIELDCAT_VBRK-EMPHASIZE = 'C500'.
X_FIELDCAT_VBRK-OUTPUTLEN = 15.
APPEND X_FIELDCAT_VBRK TO IT_FIELDCAT_VBRK.
CLEAR X_FIELDCAT_VBRK.
ENDFORM. "FIELDCATALOG_CHANGE
*& Form FIRST_SCREEN_DISPLAY
text
FORM FIRST_SCREEN_DISPLAY.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT_VBRK
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
ENDIF.
CHECK RADIO BUTTON SELECTION AND ACCORDINGLY DISPLAY LIST OR GRID ALV
IF LIST = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRK
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRK
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.
CLEAR LIST.
ENDIF.
IF GRID = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRK
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRK
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.
CLEAR GRID.
ENDIF.
ENDFORM. "FIRST_SCREEN_DISPLAY
*& Form STATUS
text
-->P_EXTAB text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STATUS' EXCLUDING P_EXTAB.
ENDFORM. "STATUS
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
LEAVE TO SCREEN 0.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = RS_SELFIELD-VALUE
IMPORTING
OUTPUT = TEMP_VBELN.
TEMP_VBELN = RS_SELFIELD-VALUE.
PERFORM GET_DATA_VBRP.
PERFORM GET_SECOND_SCREEN_DISPLAY.
ENDIF.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form GET_DATA_VBRP
text
FORM GET_DATA_VBRP.
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP INTO TABLE IT_VBRP
WHERE VBELN = TEMP_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH ' NO BILLING DETAILS FOUND'.
EXIT.
ENDIF.
ENDFORM. "GET_DATA_VBRP
*& Form GET_SECOND_SCREEN_DISPLAY
text
FORM GET_SECOND_SCREEN_DISPLAY.
FIELDCATALOG CALL
X_FIELDCAT_VBRP-TABNAME = 'IT_VBRP'.
X_FIELDCAT_VBRP-FIELDNAME = 'VRKME'.
X_FIELDCAT_VBRP-EMPHASIZE = 'C500'.
X_FIELDCAT_VBRP-OUTPUTLEN = 10.
APPEND X_FIELDCAT_VBRP TO IT_FIELDCAT_VBRP.
CLEAR X_FIELDCAT_VBRP.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT_VBRP
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
ENDIF.
CHECK RADIO BUTTON SELECTION AND ACCORDINGLY DISPLAY LIST OR GRID ALV
IF LIST = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT</b>
IT_FIELDCAT = IT_FIELDCAT_VBRP
I_SCREEN_START_COLUMN = 1
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 10
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRP
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.
IF GRID = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b> IS_LAYOUT = L_LAYOUT </b>
IT_FIELDCAT = IT_FIELDCAT_VBRP
I_SCREEN_START_COLUMN = 1
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 10
IT_EVENTS =
TABLES
T_OUTTAB = IT_VBRP
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. "GET_SECOND_SCREEN_DISPLAY -
i have a requirement where i have to customize the layout dynamically in the report output.the layout should be changed as per the selection screen field entry.is this possible?
Hi,
Check this one, How it is changing dynamically
TABLES : mara,marc.
************************Selection screen fields******************************************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,
p_meth2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK matnr
WITH FRAME TITLE text-002.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .
SELECTION-SCREEN END OF BLOCK matnr.
SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-003.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.
SELECTION-SCREEN END OF BLOCK file.
SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.
SELECTION-SCREEN SKIP 1.
PARAMETERS : p_date TYPE datuv. "CCT51576.
SELECTION-SCREEN END OF BLOCK date.
***********************Screen Validation*********************************************
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'M1'.
IF p_meth1 <> 'X'.
screen-active = 1.
ENDIF.
IF p_meth2 = 'X'.
screen-active = 0.
ENDIF.
WHEN 'M2'.
IF p_meth2 = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
IF p_meth1 = 'X'.
screen-active = 0.
ENDIF.
ENDCASE.
MODIFY SCREEN.
ENDLOOP. -
Show normal report or alv report for the radiobutton that was selected
Hello... i'm a begginer on Abap, so I hope to writly espose my question...
I'm trying to modifie an report i have to, when the user choose the values for selection, he also can choose if the output is shown as a normal view or as an alv. I want to do it by using radiobuttons, but I don´t no how to organise my code for the selected radiobutton...
ThanksHi,
Copy and paste this code. undestand the logic.
TABLES: vbrp.
TYPE-POOLS: slis.
TYPES: BEGIN OF gs_vbrp,
vbeln TYPE vbrp-vbeln, "sales order
matnr TYPE vbrp-matnr, "material no
arktx TYPE vbrp-arktx, "material description
ntgew TYPE vbrp-ntgew, "quantity
gewei TYPE vbrp-gewei, "quantity unit
netwr TYPE vbrp-netwr, "currency
werks TYPE vbrp-werks, "plant
END OF gs_vbrp.
DATA: it_vbrp TYPE STANDARD TABLE OF gs_vbrp,
wa_vbrp TYPE gs_vbrp.
DATA: fcat TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv.
DATA: lyout TYPE slis_layout_alv,
event TYPE slis_t_event,
wa_event TYPE slis_alv_event.
select-options: s_vbeln for vbrp-vbeln.
parameters: p_alv type c radiobutton group AA,
P_NORMAL TYPE C RADIOBUTTON GROUP AA.
SELECT vbeln
matnr
arktx
ntgew
gewei
netwr
werks
FROM vbrp
INTO TABLE it_vbrp
FOR ALL ENTRIES IN IT_VBRP
WHERE vbeln EQ IT_VBRP-VBELN.
IF P_ALV = 'X'.
define imacro.
wa_fcat-fieldname = &1.
wa_fcat-tabname = &2.
wa_fcat-reptext_ddic = &3.
wa_fcat-col_pos = &4.
append wa_fcat to fcat.
clear wa_fcat.
end-of-definition.
imacro 'VBELN' 'it_vbrk' 'PO Document' '1'.
imacro 'MATNR' 'it_vbrk' 'material no.' '2'.
imacro 'ARKTX' 'it_vbrk' 'Mat. description' '3'.
imacro 'NTGEW' 'it_vbrk' 'quantity' '4'.
imacro 'GEWEI' 'it_vbrk' 'quantity unit' '5'.
imacro 'NETWR' 'it_vbrk' 'net price' '6'.
imacro 'WERKS' 'it_vbrk' 'plant' '7'.
****************DEFINE LAYOUT
lyout-zebra = 'X'.
lyout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-cprog
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER'
I_CALLBACK_TOP_OF_PAGE = 'MY NAME'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'I M THAT'
I_GRID_SETTINGS =
IS_LAYOUT = lyout
IT_FIELDCAT = fcat
TABLES
T_OUTTAB = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ELSE.
LOOP AT IT_VBRP INTO WA_VBRP.
WRITE: /5 WA_VBRP-VBELN, WA_VBRP-MATNR.
ENDLOOP.
ENDIF.
Cheers,
Rudhir -
Hi everyone, I have created an ALV report, and now I've been ask to upgrade this report putting a parameter in the selection screen where the user can select a layout, and then execute the report so when the data is display appear as the layout already chosen by the user.
Can anyone tell me how to add this functionality to my alv report.
Thanks in advanced,
FidelHI Fidel,
Here is example program for List and Grid
whichever u choose that report format will be displayed
check this once.
*& Report ZLAXMI_ALVEXER2 *
*& NAME : VENKATA LAXMI *
*& DATE : 24-02-2006 *
*& PROGRAM TO PRINT THE REPORT IN ALV LIST FORMAT AND GRID FORMAT *
*& WITH TRAFFIC LIGHTS *
REPORT ZLAXMI_ALVEXER2 MESSAGE-ID ZZ .
*& TABLES DECLARATION *
TABLES: VBAK.
*& TYPE POOLS DECLARATION *
TYPE-POOLS: SLIS.
*& INTERNAL TABLE DECLARATION *
DATA: BEGIN OF ITAB OCCURS 0,
ICON TYPE ICON-ID,
VBELN LIKE VBAK-VBELN,
AUDAT LIKE VBAK-AUDAT,
VBTYP LIKE VBAK-VBTYP,
AUART LIKE VBAK-AUART,
AUGRU LIKE VBAK-AUGRU,
NETWR LIKE VBAK-NETWR,
WAERK LIKE VBAK-WAERK,
END OF ITAB.
*INTERNAL TABLE FOR FIELD CATALOG
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
WITH HEADER LINE,
*INTERNAL TABLE FOR EVENTS
DATA: IT_EVENT TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT,
*INTERNAL TABLE FOR SORTING
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV,
*INTERNAL TABLE FOR LAYOUT
WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
*& VARIABLE DECLARATION *
DATA : V_REPID TYPE SY-REPID,
V_PAGNO(4) TYPE N,
V_DATE(8) TYPE C.
*& CONSTANTS *
CONSTANTS: C_X TYPE C VALUE 'X'.
*& SELECTION SCREEN *
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
S_VBTYP FOR VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
*SELECTION-SCREEN : BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 1(20) TEXT-003.
PARAMETERS: P_LIST RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
*SELECTION-SCREEN : END OF LINE.
*SELECTION-SCREEN : BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 1(20) TEXT-004.
PARAMETERS: P_GRID RADIOBUTTON GROUP RAD1.
*SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN: END OF BLOCK B2.
AT SELECTION-SCREEN.
PERFORM VALIDATE_SCREEN.
*& START OF SELECTION *
START-OF-SELECTION.
CLEAR: ITAB, ITAB[].
V_REPID = SY-REPID.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.
*& END OF SELECTION *
END-OF-SELECTION.
*--DO ALV Process
V_REPID = SY-REPID.
*--Sort the Output Fields
PERFORM SORT_FIELDS.
*--Build Field catalog for the Output fields
PERFORM BUILD_FIELDCAT.
*--Set the Layout for ALV
PERFORM SET_LAYOUT.
*& Form GET_DATA
text
TO GET THE DATA FROM TABLES INTO ITAB
FORM GET_DATA .
SELECT VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBAK
WHERE VBELN IN S_VBELN AND
AUDAT > '04.04.2005'
AND NETWR > 0.
LOOP AT ITAB.
IF ITAB-NETWR < 10000.
ITAB-ICON = '@08@'.
ELSEIF ITAB-NETWR > 10000 AND ITAB-NETWR < 100000.
ITAB-ICON = '@09@'.
ELSEIF ITAB-NETWR > 100000.
ITAB-ICON = '@0A@'.
ENDIF.
MODIFY ITAB INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form sort_fields
FORM SORT_FIELDS .
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'VBTYP'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'NETWR'.
WA_SORT-SPOS = '2'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
ENDFORM. " sort_fields
*& Form build_fieldcat
*FORM BUILD_FIELDCAT .
IT_FIELDCAT-COL_POS = '1'.
IT_FIELDCAT-FIELDNAME = 'ICON'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '10'.
IT_FIELDCAT-SELTEXT_L = 'LIGHT'.
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '2'.
IT_FIELDCAT-FIELDNAME = 'VBELN'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '10'.
IT_FIELDCAT-SELTEXT_L = 'SALES DOC NUMBER'(009).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '3'.
IT_FIELDCAT-FIELDNAME = 'AUDAT'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '4'.
IT_FIELDCAT-SELTEXT_L = 'DOCUMENT DATE'(010).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '4'.
IT_FIELDCAT-FIELDNAME = 'VBTYP'.
IT_FIELDCAT-KEY = 'X'.
IT_FIELDCAT-OUTPUTLEN = '4'.
IT_FIELDCAT-SELTEXT_L = 'CATEGORY'(011).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '5'.
IT_FIELDCAT-FIELDNAME = 'AUART'.
IT_FIELDCAT-OUTPUTLEN = '4'.
IT_FIELDCAT-SELTEXT_L = 'DOCUMENT TYPE'(012).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '6'.
IT_FIELDCAT-FIELDNAME = 'AUGRU'.
IT_FIELDCAT-OUTPUTLEN = '12'.
IT_FIELDCAT-SELTEXT_L = 'Order reason'(013).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '7'.
IT_FIELDCAT-FIELDNAME = 'NETWR'.
IT_FIELDCAT-OUTPUTLEN = '12'.
IT_FIELDCAT-SELTEXT_L = 'NET VALUE'(014).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
IT_FIELDCAT-COL_POS = '8'.
IT_FIELDCAT-FIELDNAME = 'WAERK'.
IT_FIELDCAT-OUTPUTLEN = '12'.
IT_FIELDCAT-SELTEXT_L = 'SD DOC CURR'(015).
APPEND IT_FIELDCAT.
CLEAR IT_FIELDCAT.
*ENDFORM. " build_fieldcat
*& Form set_layout
FORM SET_LAYOUT .
IF P_LIST = C_X .
WA_LAYOUT-WINDOW_TITLEBAR = 'LIST DISPLAY'(016).
WA_LAYOUT-ZEBRA = 'X'.
*-- ALV LIST DISPLAY
PERFORM LIST_DISPLAY TABLES ITAB.
*-- ALV GRID DISPLAY
ELSEIF P_GRID = C_X.
WA_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'(017).
WA_LAYOUT-ZEBRA = 'X'.
PERFORM GRID_DISPLAY TABLES ITAB.
ENDIF.
ENDFORM. " set_layout
*& Form list_display
FORM LIST_DISPLAY TABLES P_ITAB .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_SORT = IT_SORT[]
I_SAVE = 'U'
TABLES
T_OUTTAB = 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. " list_display
*& Form GRID_DISPLAY
FORM GRID_DISPLAY TABLES P_ITAB .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_SORT = IT_SORT[]
IT_EVENTS = IT_EVENT
TABLES
T_OUTTAB = 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. " GRID_DISPLAY
*& Form VALIDATE_SCREEN
text
--> p1 text
<-- p2 text
FORM VALIDATE_SCREEN .
DATA: LV_VBELN LIKE VBAK-VBELN.
IF NOT S_VBELN IS INITIAL.
SELECT VBELN
INTO LV_VBELN
UP TO 1 ROWS
FROM VBAK
WHERE VBELN IN S_VBELN.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'INVALID SALES DOC'.
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_SCREEN
*& Form display_data
text
--> p1 text
<-- p2 text
FORM DISPLAY_DATA .
DEFINE M_FIELDCAT.
ADD 1 TO WA_FIELDCAT-COL_POS.
WA_FIELDCAT-FIELDNAME = &1.
WA_FIELDCAT-REF_TABNAME = 'VBAK'.
WA_FIELDCAT-DO_SUM = &2.
WA_FIELDCAT-CFIELDNAME = &3.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
m_fieldcat 'ICON' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'AUDAT' '' ''.
m_fieldcat 'VBTYP' '' ''.
m_fieldcat 'AUART' '' ''.
m_fieldcat 'AUGRU' '' ''.
m_fieldcat 'NETWR' 'C' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
ENDFORM. " display_data
Regards,
Laxmi -
How to enabling or disabling a layout panel by a radio button
Hello, I am new in JFS. Can any one help me that i have a layout panel which property set to visible= false initially. And i have a radio button. i would like that when i click the radio button then the layout panel will appear. please help me...............
regards,
S. M. Taibur RahmanTaiburRahman wrote:
Hello Dear,
As your advice i do this but i failed. I don't know what's the problem. As you know i am new in JSF & wed development also. I send you the source code which i compiled here. Please suggestion me the problem.
Best Regards,
S. M. Taibur Rahman
SOURCE CODE:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Page1
Created on : Feb 18, 2009, 1:22:23 AM
Author : Taibur
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page id="page1">
<webuijsf:html id="html1">
<webuijsf:head id="head1" title="Form1">
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
<SCRIPT LANGUAGE="JavaScript">
function Disab ()
document.getElementById("form1:lp1").style.visibility="visible";
//OR based upon your requirement
//document.getElementById("form1:lp1").style.visibility="hidden";
}>
</SCRIPT>
</webuijsf:head>
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<webuijsf:radioButton id="rb3" label="2" name="radioButton-group-form1" onClick="Disab()" style="left: 216px; top: 96px; position: absolute"/>Make sure you are passing the right id to your javascript. You can perform a small test on your panel layout by adding onclick="alert(this.id)" to your webuijsf:panelLayout component and use the same id in your javascript function.
<webuijsf:panelLayout id="lp1" style="border-width: 3px; border-style: dotted; border-color: rgb(102, 204, 255) rgb(102, 204, 255) rgb(102, 204, 255) rgb(102, 204, 255); height: 186px; left: 216px; top: 240px; position: absolute; width: 354px">
<h:inputText id="textField1" style="left: 123px; top: 51px; position: absolute"/>
</webuijsf:panelLayout>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>~SirG -
Defining a table field as radiobutton
Hi experts,
I have a client table with two fields defined as char 1. Now, when creating the screen for SM30, I want these two fields as radiobutton. In the layout, I have created them as radiobutton but now, I don't know how to group them. It understands there are two radiobutton groups, one for each table field. But what I want is to create a group for each table row, only one of the two fields should be marked.
Could you help me, please?
Thanks in advance,
Ainara.Grouping facility is available in module pool.
go to the layout of the screen and select all the radio-buttons columns u want to group, right-click and Grouping -> Define..
Reward point if useful
Regards
Prax
Maybe you are looking for
-
I would like know if there is a class wich one is similar to DatePicker class, but with Hours, Minutes and Seconds instead of Days, Months and Years. In case this kind of class doesn't exist . How could I get a box , button or something similar which
-
We are replacing a bunch of Crystal reports with the new interactive reports. When we download an interactive report to PDF, it automatically puts the page number at the bottom right of every page. However, I'd like it to say "Page 1 of 3", "Page 2 o
-
so i was working on a song, and when I opened the file up (a new one), the individual volume sliders for each track are not there anymore. to adjust the volume for anything I am forced to open the automation line. has anyone ever had this problem bef
-
How do see my folder in my yahoo mail?
How do I view all folders in my email yahoo, I tried all inboxes and only see current emails? I have iPad mini.
-
Hi gurus, Well, I had three questions ... Please answer me .. 1) I have defined a cursor which is going to process 10,000 records of a table .. Say, while processing, may be 1,000 record, an unknown exception may get raised .. that too which I havent