User Authorisations in Dialog Programming.
Hi Friends,
I have a small requirement, I want to create user authorisations in dialog programming.
Actually client requirement is he want to enter absence details of each and every branch.
For that i have created a cusom table and i also i have developed a dialog program inorder to update the details
and to retrive all the data i have created a report program also.
Now the client requirement is he want user authorisations while updating the data through dialog programming, that means if a user loging in that particular branch he want to enter the absence details pertaining to that branch only, when he tries to enter the details of other employee pertaining to another branch an error should be raised.
Actually in the client place they are using authrisation object as 'Z_WERKS'. The basis person has created this and provided for me.
Actually i have created an Authority check in module pool program.Here iam attaching my prog,
Pls provide me the sample code if at all available.
*& Include ZEMPTOP Module pool
PROGRAM ZEMP.
TABLES : ZABS,PA0001.
DATA : WA_PA0001 LIKE PA0001,
V_ANS.
DATA: BEGIN OF Z_WERKS OCCURS 0,
PERSA LIKE T500P-PERSA,
NAME1 LIKE T500P-NAME1,
END OF Z_WERKS.
*& Include ZEMPI01
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'DISP'.
SELECT SINGLE * FROM ZABS WHERE PERNR = ZABS-PERNR.
IF SY-DBCNT <> 0.
*MESSAGE I000(Z00) WITH 'Details of' ZABS-PERNR .
else.
MESSAGE I000(Z00) WITH 'No Details Available to Display'.
ENDIF.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'CLS'.
CLEAR ZABS.
WHEN 'INS'.
INSERT ZABS .
ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
IF SY-DBCNT <> 0.
MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
'inserted successfully'.
ENDIF.
CLEAR ZABS.
WHEN 'MOD'.
UPDATE ZABS.
ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
IF SY-DBCNT <> 0.
MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
'Modified Successfully'.
ENDIF.
CLEAR ZABS.
*WHEN 'DEL'.
*CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
EXPORTING
TEXTLINE1 = 'ARE YOU SURE'
TEXTLINE2 = 'YOU WANT TO DELETE'
TITEL = 'CONFIRMATION'
START_COLUMN = 25
START_ROW = 6
DEFAULTOPTION = 'N'
IMPORTING
ANSWER = V_ANS.
*IF V_ANS = 'J'.
*DELETE ZABS.
*IF SY-DBCNT <> 0.
*MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
*'Deleted Successuflly'.
*ELSE.
*MESSAGE I000(Z00) with 'No Record to Delete'.
ENDIF.
*ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module GET_REC INPUT
text
MODULE GET_REC INPUT.
SELECT SINGLE * FROM PA0001 INTO WA_PA0001
WHERE PERNR = ZABS-PERNR.
MOVE: WA_PA0001-PERNR TO ZABS-PERNR,
WA_PA0001-ENAME TO ZABS-ENAME,
WA_PA0001-GSBER TO ZABS-GSBER,
WA_PA0001-WERKS TO ZABS-WERKS.
ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
ENDMODULE. " GET_REC INPUT
*& Module CHECK_AUTH_WERKS INPUT
text
MODULE CHECK_AUTH_WERKS INPUT.
*SELECT PERSA INTO TABLE _WERKS FROM T500P
WHERE PERSA = ZABS-WERKS.
AUTHORITY-CHECK OBJECT 'Z_WERKS'
ID 'PERSA' FIELD Z_WERKS-PERSA.
You need to test the sy-subrc after the authority check - that will indicate whether the user has the authorisation or not.. you also often include the activity being tested e.g. generally 03 = Display, 02 = Update etc
AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
ID 'ACTVT' FIELD '03'
ID 'CUSTTYPE' FIELD 'B'.
IF not SY-SUBRC is initial.
MESSAGE E... "put your exception here...
ENDIF.
see [Programming Authorization Checks |http://help.sap.com/saphelp_nw04/helpdata/en/52/6712ac439b11d1896f0000e8322d00/content.htm] for more info.
Jonathan
Similar Messages
-
Multiple users with single dialog..
Hi,
How to handle multiple user activities in dialog programming ?
In my custom dialog transaction, there is very little probability that two or more will be working on the same data. But in case by chance, two people try to modify the same data, how should that be handled ?
Can anyone explain in detail?
thksYes, you should always, regardless of chances, use lock objects when updating database tables. These are generated in the ABAP dictionary for each table, or you could define it to cover mulitple tables at one time. It will also generate functions modules, ENQUEUE_<name of lock object> and DEQUEUE_<name of lock object>, which you use to Lock, and Unlock..
http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm
Regards,
Rich Heilman -
Save/create a variant in user defined screen in dialog program
is there a way to save/create a variant in user defined screen in dialog program?
thanks...Few important tables for Variants:
VARI - ABAP/4: Variant storage (similar to INDX)
VARID - Variant directory
VARINUM - Internal number assignment for variants
VARIT - Variant texts
TVARV - Table of variables in selection criteria
TVARC - Variant conditions
TVARUVN - Individual Variant Variable: Assignment TVARV
TVARCT - Text for Variants Conditions
TVARH - Header entries for screen variants
TVARIND - Save screen variants
Regards,
Vishal -
User authorisation check in ABAP-HR program
Hi,
Can anyone please help me on the following query ?
I need to check user authorisation in an ABAP report at Object level, filter only relevant records based on the user's authorisation and display appropriate messages.
The above mentioned report is purely developed by us and is not a copy of any standard report. Hence, kindly help me with your suggestions and opinions.
Thanks and Regards,
Manas MenonCreate an authorisation object (SU21)
Put an authorisation check for this object in your report (AUTHORITY-CHECK)
Create a role that contains this object (PFCG)
Assign this role to all the users who require access to the report (SU01).
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 2:07 PM -
What is difference between report programming and dialog programming?
hi,
what is difference between report programming and dialog programming? plz provide some example code
byeABAP programming
Basically reports are used to read database and represent the results in lists.
Reports are collections of processing blocks that the system calls depending on events.
We can use reports to evaluate data from database tables.
Reports are stand alone programs and controlled by events.
A report itself never creates events
steps in report:
Processing the selection screen
Reading the database
Evaluating the data and creating lists
Outputting a list.
1st u write simple logics, after that u can enhance the code as step by step.
http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/index.htm
http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
http://www.sapdev.co.uk/reporting/reportinghome.htm
Dialog Programming
Structure of a Dialog Program
A dialog program consists of the following basic components:
Screens (dynpros)
Each dialog in an SAP system is controlled by dynpros. A dynpro (DYnamic PROgram) consists of a screen and its flow logic and controls exactly one dialog step. The flow logic determines which processing takes place before displaying the screen (PBO-Process Before Output) and after receiving the entries the user made on the screen (PAI-Process After Input).
The screen layout fixed in the Screen Painter determines the positions of input/output fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
ABAP/4 module pool
Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
Check this link for basics.
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
Check this link for Dialog Programming/Table Control
http://www.planetsap.com/Tips_and_Tricks.htm#dialog
Check this SAP Help for Dialog Program doc.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
Check this SAP Help link for Subscreens.
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
Check this link for subscreen demo program.
http://abapcode.blogspot.com/2007/05/demo-program-to-create-subscreen-in.html
Also check this link too.
http://abapcode.blogspot.com/2007/06/dialog-programming-faq.html
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld004.htm
http://help.sap.com/saphelp_nw04/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ccf35c111d1829f0000e829fbfe/frameset.htm
http://abapprogramming.blogspot.com/ -
Dialog programming, data being washed out in TAB Control
Hi,
i am working on dialog programming , in which i am using Table Control for user input (data is not coming from database table) . everything is going well till assignment of data to internal table but when
control goes to PBO by any means like pressing ENTER etc. then data being washed out.
PROCESS BEFORE OUTPUT.
MODULE TC_CONTROL.
LOOP AT it_data
INTO wa_data
WITH CONTROL tc_control
CURSOR tc_control-current_line.
MODULE tc_control_get_lines.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT IT_DATA.
CHAIN.
FIELD WA_DATA-FREPS_N.
FIELD wa_data-TOEPS_N.
FIELD wa_data-PRCH_A.
FIELD wa_data-SRVC_AMT .
FIELD wa_data-ACCNT_C.
FIELD wa_data-AMT_D.
FIELD wa_data-NARR_X.
FIELD wa_data-CRPRD_N.
MODULE tc_control_modify ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
*Abap program
MODULE TC_CONTROL OUTPUT.
DESCRIBE TABLE it_data LINES tc_control-lines.
ENDMODULE. " TC_CONTROL OUTPUT
CONTROLS: TC_CONTROL TYPE TABLEVIEW USING SCREEN 1000,
TC_CONTROL1 TYPE TABLEVIEW USING SCREEN 1000.
DATA: G_TC_CONTROLS_LINES LIKE SY-LOOPC,
G_TC_CONTROLS_LINES1 LIKE SY-LOOPC.
*& Module tc_control_get_lines OUTPUT
text
MODULE tc_control_get_lines OUTPUT.
g_tc_controls_lines = sy-loopc.
move-corresponding it_data to wa_data.
ENDMODULE. " tc_control_get_lines OUTPUT
MODULE tc_control_modify INPUT.
move-corresponding wa_data to it_data.
MODIFY it_data
FROM wa_data
INDEX tc_control-current_line.
append it_data.
clear it_data.
ENDMODULE. " tc_control_modify INPUT
Please suggest me any clue.
Thanks in advance
vijay dwivediHi ,
I have understood the problem.
In your ABAP code replace all the occurrrences of wa_data with the structurename.
Use the TABLES keyword to declare the structure .That structure will be same as
reference table of the table control .
Here the structure is SPFLI.
Check the bellow code , it will resolve the issue.
ABAP code - -
program zsdn.
tables spfli. " Declare the structure
data : it_data like table of spfli with header line,
*wa_data TYPE spfli, " commented
w_i type i.
*CONTROLS TC_CONTROL TYPE TABLEVIEW USING SCREEN 100.
controls: tc_control type tableview using screen 1000,
tc_control1 type tableview using screen 1000.
data: g_tc_controls_lines like sy-loopc,
g_tc_controls_lines1 like sy-loopc.
module tc_control output.
describe table it_data lines tc_control-lines.
endmodule. " TC_CONTROL OUTPUT
module tc_control_get_lines output.
g_tc_controls_lines = sy-loopc.
move-corresponding it_data to spfli.
endmodule. " tc_control_get_lines OUTPUT
module tc_control_modify input.
move-corresponding spfli to it_data.
modify it_data
from spfli
index tc_control-current_line.
append it_data.
clear it_data.
endmodule. " tc_control_modify INPUT
module status_0100 output.
set pf-status 'STAT'.
* SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
module user_command_0100 input.
case sy-ucomm.
when 'BACK' or 'EXIT' or 'CANCEL'.
leave to screen 0.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Module POPLATE_TABLE OUTPUT
* text
module poplate_table output.
if it_data is initial.
select * from spfli into table it_data.
endif.
endmodule. " POPLATE_TABLE OUTPUT
Screen code (Scr no 1000) - -
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE poplate_table.
MODULE tc_control.
LOOP AT it_data WITH CONTROL tc_control CURSOR w_i.
MODULE tc_control_get_lines.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0100.
LOOP AT it_data.
MODULE tc_control_modify ON CHAIN-REQUEST.
* ENDCHAIN.
ENDLOOP.
Regards
Pinaki -
How to call a dialog program with return value in another dialog program
Dear All,
How can I call a dialog program with return value from another dialog program?
Regards,
Alok.Hi Alok,
You can you SET/GET parameters to do this.
This is some information about this.
To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
To fill one, use:
SET PARAMETER ID pid FIELD f.
This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
To read an SPA/GPA parameter, use:
GET PARAMETER ID pid FIELD f.
This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
Thanks,
SriRatna -
Using CheckBox / Radio-Button Control in Dialog Program
Dear Friends,
Please let me know the way to use check-box / radio-button control in dialog programs. Where & how to define them & write the logic.
If possible provide a small example.
Regards,
Alok.Hi,
goto tcode abapdocu.. abap user dialogs - screens-processing screens you will get examples for all --pushbutt6ons radiobutton checkboxes everything
<b>here is a sample code for you</b>
PROGRAM demo_dynpro_check_radio .
DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
box TYPE c.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'RADIO'.
IF radio1 = 'X'.
field1 = 'Selected!'.
CLEAR: field2, field3.
ELSEIF radio2 = 'X'.
field2 = 'Selected!'.
CLEAR: field1, field3.
ELSEIF radio3 = 'X'.
field3 = 'Selected!'.
CLEAR: field1, field2.
ENDIF.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
<b>flow logic:</b>
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE user_command_0100.
regards,
pankaj singh.
<i><b>
reward if helpful</b></i> -
Select-options in Dialog Programming
Hi,
I am designing a custom dialog programming screen.
I want to create a filed on thescreen which can allow the range of values to be entered like select-options in a report.
How do I create a field which can accept range of values in dialog programming?
Thanks,
Ashok.Hi,
In your selection screen program, Use Export command
Export r_Purchase_Order To Memory Id 'PO'.
Export r_Po_Item To Memory Id 'POITEM'.
Export r_Plant To Memory Id 'PLANT'.
Export r_Vendor To Memory Id 'VENDOR'.
Export r_Material To Memory Id 'MATNR'.
Export r_Batch To Memory Id 'BATCH'.
Export r_Arrival_Date To Memory Id 'ADATE'.
Export r_Arrival_Time To Memory Id 'ATIME'.
Export r_Delivery_No To Memory Id 'DEL'.
Export r_Reference_No To Memory Id 'REF'.
Export r_User To Memory Id 'USER'.
Export t_Display_Data To Memory Id 'DISPDAT'.
In your Module pool program, Use Import Command
When c_Ok_0100_Execute.
IMPORT r_Purchase_Order From Memory Id 'PO'.
IMPORT r_Po_Item From Memory Id 'POITEM'.
Import r_Plant From Memory Id 'PLANT'.
Import r_Vendor From Memory Id 'VENDOR'.
Import r_Material From Memory Id 'MATNR'.
Import r_Batch From Memory Id 'BATCH'.
Import r_Arrival_Date From Memory Id 'ADATE'.
Import r_Arrival_Time From Memory Id 'ATIME'.
Import r_Delivery_No From Memory Id 'DEL'.
Import r_Reference_No From Memory Id 'REF'.
Import r_User From Memory Id 'USER'.
Import t_Display_Data From Memory Id 'DISPDAT'.
Thanks -
Problem with spool request generation in Dialog program
Hi,
To give the spool and print functionality in dialog program i have used the function module code like below -
call function 'GET_PRINT_PARAMETERS'
exporting
mode = ' '
in_parameters = ls_pri_params
importing
out_parameters = ls_pri_params
valid = lv_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
IF lv_valid <> space AND sy-subrc = 0.
SUBMIT (sy-repid)
USER SY-UNAME TO SAP-SPOOL
SPOOL PARAMETERS ls_pri_params
WITHOUT SPOOL DYNPRO.
But the problem is, if it is list then we can easily get the print function, since i am using the above code in the dialog program screen 9000, program is giving dump like....
Incorrect program type with SUBMIT.
What happened?
The current ABAP/4 program "SAPMYXXXXXX" had to be terminated because
one of the statements could not be executed.
This is probably due to an error in the ABAP/4 program.
You attempted to start a program not intended for this purpose.
I know that i should not use submit statement for dialog program, but what is the solution for this.
Thanks in advance..Did you check the F1 help of SUBMIT. if not give a try.Submit cannot be used on Module pool programs. it is used for Report(executable ) programs.
-
!!!! Urgent !!!!!!!!Dialog Programming
In Dialog Programming i have 3 fields, if one field is validated if it is true the next two fields should become gray,so no one can enter the values in those two fields how can i do it.
HI,
Go thru this docu.
<b>Changing The Screen During Runtime</b>
The attributes are assigned to the screen field when the screen is designed in full screen editor. Such kind of assignment is static, which means that these attributes are fixed. But many times the need to change the attributes of the screen arises. And this has to be done during runtime.
Need To Change Screen
There can be a requirement in the transaction that, certain fields on the screen
Appear only in certain conditions.
Are in Change/display mode according to user inputs
Become mandatory subject to specific inputs.
Changes its format depending upon certain conditions.
Modifying the screen
At the runtime, attributes for each screen field is stored in system defined internal table, with header line, called as SCREEN TABLE. It contains name of field and its attributes. This tab le can be modified during the runtime i.e. through module pool program. Screen table has following fields:
Field Name Length Description
NAME 30 Name of screen field
GROUP1 3 Field belongs to field group1
GROUP2 3 Group 2
GROUP3 3 Group 3
GROUP4 3 Group 4
ACTIVE 1 Hide/Show
REQUIRED 1 Field input is mandatory
INPUT 1 Enable/Disable
OUTPUT 1 Field for display only
INTENSIFIED 1 Field is highlighted.
INVISIBLE 1 Field is suppressed.
LENGTH 1 Field output length is reduced
DISPLAY 3D 1 Field is displayed with 3-D Frame
VALUE_HELP 1 Field is displayed with Value help
E.g., SCREEN-ACTIVE = 0 has the same effect as the following statements.
SCREEN- INPUT = 0.
SCREEN-OUTPUT = 0.
SCREEN-INVISIBLE = 1.
The fields SCREEN-NAME and SCREEN-GROUP 1 through SCREEN-GROUP4 tell you which field and / or field group has the attributes.
You can assign up to 4 groups to a field.
You need to program screen modifications in module, which is processed during the event PROCESS BEFORE OUTPUT.
`SCREEN is an internal table and, in order to change the field values, LOOP statement has to be used so that the header-line can be populated with the new values, changing the earlier values, the SCREEN table consisted for the specific screen. Finally the changed record in the header-line is NOT APPENDED, but is MODIFIED to the SCREEN table. That is, we first use `LOOP AT SCREEN and then assign the values. And finally PRIOR TO ENDLOPP give `MODIFY SCREEN.
PROCESS BEFORE OUTPUT.
MODULE MODIFY_SCREEN OUTPUT.
MODULE MODIFY_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = SFLIGHT-CARRID.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Thanks
Sunil -
Help needed to write a dialog program
Hello ABAP Gurus,
I am very much new to ABAP Programming.
Can anybody help me to write a simple Dialog Program ??
I have a database table.
I have created a screen with screen painter, and kept some input fields & a push button in it.
I want to fill the database table with the data entered into the fields on the screen.
When the user enters the data and presses the PUSH BUTTON then that data record should be stored into the Database table.
So what kinda code I have to write in PAI (Process After Input), to achieve this functionality ??
The help will be greatly appreciated.
Thanks in advance
Best regards
Ravi
Edited by: Ravi Kiran on Oct 28, 2009 2:17 PMIt's easy:
In PAI you have do an insert into a database table, following the steps:
1.on PAI create a module: for exemple Zwrite_table.
2. inside Zwrite_table code as follow:
move var1 to wa_table-var1.
move var2 to wa_table-var2.
move var3 to wa_table-var3. etc etc
insert table ztable from wa_table.
P.s. ztable is a database table.
wa_table is a structure that have the same structure of ztable.
var1 var2 var3 etc is a variable inside your dynpro.
regards,
Roberto. -
Hi all,
Fora search help in dialog program.
I HAVE TO GET SEARCH FOR A FIELD ZID ON APARTICULAR SCREEN BASED ON DATA, MODIFIED BY AND A PLANT..
I HAVE A RECORD IN ONE MY ZTABLE.
I HAVE TO GET THAT BY SEVERAL SEARCH PARAMETERS SAY BY DATE , MODIFIED BY,PLANT ETC.
each user has been assigned a plant , so in search he has to get records belonging to that plant.
so i cannot include plant in my search help, because user may type in other plant.
so i tried two ways
1) i created a search help in se11 including the plant field again the problem arises if the user types a different plant.
so i want to know whether we can apassa value to plant field in search help(i.e the plant assigned to the user),
i have this kind of thing in some standard t -code i.e especially for searching material , the plant field in search help was filled by one plant.
this should be one of the solution
2)I tried to write a code in pov of program code.
this is how my code looks.
DATA : BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE ZXXX.
DATA : END OF ITAB.
ITAB HAS FIELDS ID, DATE , MODIFIEDBY , PLANT.
USER_PLANT = 'ABC'.
SELECT * FROM ZXXX INTO TABLE ITAB WHERE PLANT = USER_PLANT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'ZID'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE = 'TEST'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITAB
FIELD_TAB =
RETURN_TAB = IT_RETURN4
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if sy-subrc = 0.
clear itab.
read table it_return4 index 1.
ZXXX-ZID = it_return4-fieldval.
endif.
THIS WORKS FINE , BUT HE CANNOT SEARCH BASED ON DATE AND MODIFIEDBY
ALL i want is is get a pop up window and should be able to search based on data and modifiedby for a predifined plant.
I hope iam clear.
ThanksHi,
Create a FM with the following code..The interface is defined in the code..
In the Function module top include add the following code.
<b>TYPE-POOLS: shlp, vrm.</b>
IN this code I am deleting the records that are not of the currency USD...
Do the same thing for your requirement...
FUNCTION Y_SEARCH_HELP_EXIT.
""Local interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCR_T
*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
where z_test is my z table..
DATA: ITAB LIKE Z_TEST OCCURS 0 WITH HEADER LINE.
ITAB[] = RECORD_TAB[].
IF NOT RECORD_TAB[] IS INITIAL.
DELETE ITAB WHERE WAERS <> 'USD'.
RECORD_TAB[] = ITAB[].
ENDIF.
ENDFUNCTION.
Thanks,
Naren -
Selction screen in dialog program
Hi All..
In my requirement, i need a selection screen that has a parameter for the PO number. Based on the valid PO number, the line items of the PO need to be displayed on the screen where the user should be able to split the line items into different batches.
Once batch split is done, need to do a GR for the updated split data. Appreciate your help on how this can be acieved. Can we design a selection screen in dialog program ?
Also how we can provide the split functionality (insertion of new rows for main line items to have the user enter new rows for exisitng line items to enter new batch number and quantity).
Thanks and appreciate your help.<i>Can we design a selection screen in dialog program ?</i>
Yes, you can be defining the selection screen as a subscreen and then embeding in a subscreen area of a dynpro, but it is hardly worth it for just a parameter, it would be a different story if it were a select-option.
You can simply add the parameter to the dynpro using a regular input field.
Regards,
Rich HEilman -
Dialog program that lists an ALV Grid
Hello Experts,
i want to create a <b>screen divided in two parts</b>. The <b>upper side</b> shows general(Header) information and the <b>lower side</b> shows detail information using ALV grid.
When i select a record in the header of the Upper side grid , then the lower side grid will display the corresponding details.
( Initially the first record should be selected and the details for that first record will be displayed . Later user can choose any other record .........)
Could anyone pls tell me the detailed procedure for developing this..i need help.
Thanks & Best Regards
SudhansuThis example is implemented using docking containers on a selection screen to give you a cut and paste example. Simply copy and past the code into a test program and run it. double click on any line item from the grid at the top. the grid at the bottom will change.
report zrich_0001.
data: imara type table of mara.
data: xmara like line of imara.
data: imarc type table of marc.
data: dockingbottom type ref to cl_gui_docking_container,
dockingtop type ref to cl_gui_docking_container,
alv_bottom type ref to cl_gui_alv_grid,
alv_top type ref to cl_gui_alv_grid,
repid type syrepid.
* CLASS lcl_event_handler DEFINITION
class lcl_event_handler definition.
public section.
class-methods handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column.
endclass.
* CLASS lcl_event_handler IMPLEMENTATION
class lcl_event_handler implementation.
method handle_double_click.
read table imara into xmara index e_row-index.
select * into table imarc from marc
where matnr = xmara-matnr.
call method alv_bottom->refresh_table_display( ).
endmethod.
endclass.
parameters: p_check type c.
start-of-selection.
at selection-screen output.
repid = sy-repid.
select * into corresponding fields of table imara
from mara up to 100 rows.
read table imara into xmara index 1.
check dockingbottom is initial.
create object dockingtop
exporting repid = repid
dynnr = sy-dynnr
side = dockingtop->dock_at_top
extension = 200.
create object alv_top
exporting i_parent = dockingtop.
call method alv_top->set_table_for_first_display
exporting
i_structure_name = 'MARA'
changing
it_outtab = imara[].
* handler for ALV grid
set handler lcl_event_handler=>handle_double_click for alv_top.
create object dockingbottom
exporting repid = repid
dynnr = sy-dynnr
side = dockingbottom->dock_at_bottom
extension = 200.
create object alv_bottom
exporting i_parent = dockingbottom.
select * into table imarc from marc
where matnr = xmara-matnr.
call method alv_bottom->set_table_for_first_display
exporting
i_structure_name = 'MARC'
changing
it_outtab = imarc[].
The implementation in a dialog program is pretty much the same, you do the logic in the PBO and use custom containers instead of docking containers.
Regards,
RIch Heilman
Maybe you are looking for
-
Passing a variable to set a movieclip location
In frame 1 of the the movie I have defined the following: var cl_y=502.0; Elsewhere, I am running the following script: -- seaty is the original position of the movie clip as defined in frame 1 var seaty = this+"_y"; -- resets the position of the mov
-
Pdf urls not loading in Android on 32 viewer
Hi, PDFs in HTML Resources link and download fine into Reader on Droid from the new 32 viewer, but links to pdfs online only produce a blank screen. It does not prompt you to download/view it anywhere. The same pdf url works fine when viewed on the n
-
"Open Item Managed" for Bank GL accounts
I am trying to tell my users that they should set the bank GL accounts (not the bank clearing account) as "open item managed". Our users have been clearing the bank accounts down to make it exactly the same as the bank statement. All the SAP Helps
-
Hello, We are implementing SAP PLM for a high-tech company which designs and manufactures mobile phones (ODM). Since we are new in PLM consulting and we are facing with some implementation difficulties, we are looking for some solutions here. Questio
-
Video Call button doesn't existed in Gtalk applica...
Hi programmers I've a problem of Gtalk Video Call , I installed it from OVI stores and the program works on voice call ONLY , While the video call button not existed . I made many of voice call with my friends by it ,but i can't benefited from the v