Regarding event parameters
hi all,
I am dynamically creating linkto actions for my application.
The screen shows the created links.
When i am clicking a particular link i want to get that linkname as a argument for another function.
How do i do it.
Should i do it by sourcemapping or by addparameter.I tried with them but i cant find out what parameter to map and where to map.
Please do clarify me in this regard,
Regards,
Bharathwaj
Hi Bharat,
You can create seperate Actions but mapping it to the same event handler
Regards
Noufal
Similar Messages
-
Event Parameters in WDA from Flash
Hi experts
I've alredy created a WDA with Flash inside in wich i send data from WDA and Flash make graphics.
Now i need to interact from Flash to WDA sending an event with values.
I found how to send event from Flash (fireEvent) and how to detect that event in WDA (adding and event) and get the values in WDA ; but that values are transfered just like the other context nodes, just with 'readOnly' property empty and in Flash these values are just public variables (not parameters in fireEvent).
I see we can add parameters in WDA Event , does somebody knows where can i search about how to manage parameters in WDA Event received from Flash (and how to send these parameters from Flash in the 'fireEvent') ?
Any help will be usefull.
Best Regards
Frank>does somebody knows where can i search about how to manage parameters in WDA Event received from Flash (and how to send these parameters from Flash in the 'fireEvent') ?
You can add the parameters into the fireEvent method. In this sample I have the Event name newDirections. I am adding the event parameter named dirString and the value is the variable dirS. You pass event parameters in this name/value pair format.
FlashIsland.fireEvent(this,"newDirections",{dirString:dirS});
From the ABAP side I can retrieve the event parameter from within the Event Handler method of the controller as follows:
data dir_results type string.
dir_results = wdevent->get_string( 'dirString' ).
check dir_results is not initial. -
How to pass background event parameters to ABAP program in SM36
Hi team,
I want to pass background event parameters to ABAP program on job scheduling in SM36. For example, Background jobs will trigger, once background event triggered from Non-SAP system using SAPEVT command with parameters.
I want to pass the event parameter values to the ABAP program . Can you please help me on this.
Regards,
Anand KrishnanHi,
Which ABAP program - the one that will be executed as a job step? If yes, I don't believe you can "pass" something to it because it will be started by "job starter" of SAP background processing run-time system. The ABAP program executed in background can, however, get the job run-time information using FM GET_JOB_RUNTIME_INFO, which also returns EVENTID and EVENTPARM. Is that the event parameters you were looking for?
cheers
Jānis -
Function to retrieve event parameters from job
Hello,
Is there a function to retrieve the event parameters for a job.
This job is triggered by an event.
Regards, MichelCheck in TBTCP and TBTCO Table there in some field it i s mentioned..
TBTCP and TBTCO is the table which stores job details .. -
Passing event parameters to copy of DECISION task TS20000118
Hi.
I have made a copy of the decision task TS20000118 which is the standard approve/reject user decision step.
In the decision step, i have a link to ME13 transaction which is done by passing object_id and giving the "display" method as default method for the ZBUS3003 object which takes Info record number as key.
My problem is users are restrcited by PORG auth object in ME13 also and along with Info record number, i have to pass porg, plant, vendor , material to ME13 link.
I have defined event parameters to capture this 4 fields but i dont know where to pass this parameters as TS20000118 where the link appears in using the DECISION object and not the DISPLAY method,.
I dont want to make this 4 fields as object key because it will mean altering many other things. Also, int he DISPLAY method based on info record number i cannot retrieve 4 fields bcos there mioght be multiple records for same info record number.
Appreciate if you can let me know how i can pass event parameters to ME12 link in DECISION step of Task TS20000118 .
Regards
PN.Hello user12628! I have the same problem. Did you solve it? I have dynamically generated size of my Event Parameter String[] mass. And some times I have Error that URL string very long :). That is why I want to use POST method instead GET. if you has found solution,please let me know.
Message was edited by:
kostik -
Questions regarding *dump_dest parameters and fast_recovery_area
Hello,
I just installed a fresh new 11.2.0.2 Database on Solaris 10.
Everything straightforward on the parameter side!!! I tried custom install as well as general purpose template. When installing with DBCA, I set every parameters around DB Name in lowercase name.
With this, questions are popping in my mind regarding some parameters after installation.
First, %dump_dest parameters contains in path, two times the db name (ocpdb in my case):
background_dump_dest /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/trace
user_dump_dest /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/trace
core_dump_dest /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/cdumpIs it normal to have ..../rdbms/dbname/dbname/..... as path, with dbname/dbname ??? Why?
Second, the question regarding the directory structure under fast_recovery_area (new term for flash_recovery_area). The directory structure:
oracle@enalab13:/u01/app/oracle/fast_recovery_area$ ls -l
total 2
drwxr-x--- 2 oracle oinstall 512 2010-10-28 19:53 ocpdb
drwxr----- 5 oracle oinstall 512 2010-10-29 07:44 OCPDB
oracle@enalab13:/u01/app/oracle/fast_recovery_area$ ls -l ocpdb
total 9528
-rw-r----- 1 oracle oinstall 9748480 2010-10-31 21:09 control02.ctl
oracle@enalab13:/u01/app/oracle/fast_recovery_area$ ls -l OCPDB/
total 3
drwxr----- 5 oracle oinstall 512 2010-10-31 03:48 archivelog
drwxr----- 3 oracle oinstall 512 2010-10-29 07:44 autobackup
drwxr----- 3 oracle oinstall 512 2010-10-29 07:43 backupsetWhy am I having a subdir with dbname in uppercase AND in lowercase? Should I specify dbname in uppercase at db creation to have all files under the same directory, or in lowercase? Or, is it normal?
I want to know how to do it well before reinstalling a fresh database.
Thanks
Bruno
Edited by: blavoie on Oct 31, 2010 6:18 PM
Edited by: blavoie on Oct 31, 2010 6:20 PMHi,
I just reinstalled all from scratch, everything in lowercase as well in environment variables and dbname in dbca:
oracle@enalab13:~$ echo $ORACLE_SID
ocpdbFast recovery area directories, dates prove that it's my fresh install:
oracle@enalab13:/u01/app/oracle$ ll fast_recovery_area/
total 2
drwxr-x--- 2 oracle oinstall 512 2010-11-02 11:06 ocpdb
drwxr-x--- 4 oracle oinstall 512 2010-11-02 11:24 OCPDB
oracle@enalab13:/u01/app/oracle$ ll -R fast_recovery_area/
fast_recovery_area/:
total 2
drwxr-x--- 2 oracle oinstall 512 2010-11-02 11:06 ocpdb
drwxr-x--- 4 oracle oinstall 512 2010-11-02 11:24 OCPDB
fast_recovery_area/ocpdb:
total 9528
-rw-r----- 1 oracle oinstall 9748480 2010-11-02 11:34 control02.ctl
fast_recovery_area/OCPDB:
total 2
drwxr-x--- 3 oracle oinstall 512 2010-11-02 11:24 archivelog
drwxr-x--- 2 oracle oinstall 512 2010-11-02 11:06 onlinelog
fast_recovery_area/OCPDB/archivelog:
total 1
drwxr-x--- 2 oracle oinstall 512 2010-11-02 11:24 2010_11_02
fast_recovery_area/OCPDB/archivelog/2010_11_02:
total 47032
-rw-r----- 1 oracle oinstall 48123392 2010-11-02 11:24 o1_mf_1_5_6f0c9pnh_.arc
fast_recovery_area/OCPDB/onlinelog:
total 0Some interresting output asked earlier in post:
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
SQL> show parameter recovery
NAME TYPE VALUE
db_recovery_file_dest string /u01/app/oracle/fast_recovery_area
db_recovery_file_dest_size big integer 4032M
recovery_parallelism integer 0
SQL> show parameter control_files
NAME TYPE VALUE
control_files string /u01/app/oracle/oradata/ocpdb/control01.ctl,
/u01/app/oracle/fast_recovery_area/ocpdb/control02.ctl
SQL> show parameter instance_name
NAME TYPE VALUE
instance_name string ocpdb
SQL> show parameter db_name
NAME TYPE VALUE
db_name string ocpdb
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_11 string
log_archive_dest_12 string
log_archive_dest_13 string
log_archive_dest_14 string
log_archive_dest_15 string
log_archive_dest_16 string
log_archive_dest_17 string
log_archive_dest_18 string
log_archive_dest_19 string
SQL> show parameter %dump_dest
NAME TYPE VALUE
background_dump_dest string /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/trace
core_dump_dest string /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/cdump
user_dump_dest string /u01/app/oracle/diag/rdbms/ocpdb/ocpdb/traceI think, next time, I'll install everything regarding oracle SID in upper case...
Maybe it's details that I don't need to care about... I seems that something is happening bad with the management of fast_recovery_area...
Thanks
Bruno -
How to Enter Event Parameters in FM SAP_WAPI_CREATE_EVENT_EXTENDED
Hi,
I am trying to trigger theEvent 'START_RM_WEBREQ' for an ABAP Class 'CL_HREIC_RM_WORKFLOW' using the above mentioned FM.
Usually this can be done using SWUE, however I am asked to do it create a custom program that would do the functionality for SWUE.
Problem is I cannot figure out how do I enter the Parameters of the Event via this FM SAP_WAPI_CREATE_EVENT_EXTENDED.
The event parameters for the event 'START_RM_WEBREQ' is Object Type and Key. Usually when doing it via SWUE we are prompted with a dynamic screen which asks us to populate the values.
Please help.
Thanks,
PabloHi,
Thank you for your response. But I am facing the same problem there. I am not able to populate the value of the Parameter for the event START_RM_WEBREQ.
The code I had written initially is similar to the one in the link that you have sent:
TABLES: swotobjid.
SELECT-OPTIONS: s_notif FOR swotobjid-objkey NO INTERVALS .
DATA: lv_objtype TYPE sibftypeid,
lv_event TYPE sibfevent,
lv_objkey TYPE sibfinstid,
lr_event_parameters TYPE REF TO if_swf_ifs_parameter_container,
lv_param_name TYPE swfdname,
lv_value TYPE char80.
lv_objtype = 'CL_HREIC_RM_WORKFLOW'.
lv_event = 'START_RM_WEBREQ'.
LOOP AT s_notif.
lv_objkey = s_notif-low.
*Instantiate an empty event container
CALL METHOD cl_swf_evt_event=>get_event_container
EXPORTING
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
RECEIVING
re_reference = lr_event_parameters.
*Set up the name/value pair to be added to the container
lv_param_name = 'NOTIFICATION'.
CONCATENATE 'BUS7051' lv_objkey INTO lv_value SEPARATED BY space.
*Add the name/value pair to the event conainer
TRY.
CALL METHOD lr_event_parameters->set
EXPORTING
name = lv_param_name
value = lv_value.
CATCH cx_swf_cnt_cont_access_denied .
CATCH cx_swf_cnt_elem_access_denied .
CATCH cx_swf_cnt_elem_not_found .
CATCH cx_swf_cnt_elem_type_conflict .
CATCH cx_swf_cnt_unit_type_conflict .
CATCH cx_swf_cnt_elem_def_invalid .
CATCH cx_swf_cnt_container .
ENDTRY.
Raise the event passing the prepared event container
TRY.
CALL METHOD cl_swf_evt_event=>raise
EXPORTING
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
im_objkey = lv_objkey
im_event_container = lr_event_parameters.
CATCH cx_swf_evt_invalid_objtype .
CATCH cx_swf_evt_invalid_event .
ENDTRY.
COMMIT WORK.
MESSAGE s736(wz).
ENDLOOP. -
Logic regarding EVENTS OnFilter and OnLeadSelect for table ui element
provide me logic regarding EVENTS OnFilter and OnLeadSelect for table ui element for webdynpro abap application.
OnLeadSelect - What kind of logic do you want? There are many different things that you could do inthe OnLeadSelect
onFilter- Generally you use IF_WD_TABLE_METHOD_HNDL~APPLY_FILTER to perform the filter operation.
In the onFilter itself you probably just have one line of code:
wd_this->table_method_hndl->apply_filter( ).
In your WDDOMODIFYVIEW you probably have this code to capture the table_method_hndl object:
if first_time = abap_true.
* Get reference of the table view element
l_table ?= view->get_element( 'TABLE' ).
* Get reference to the Filter & Sorting API
wd_this->table_method_hndl ?= l_table->_method_handler.
endif. -
A Query regarding 'Events' published and 'Event' subscribed
I have a query regarding 'Events' and 'EventHandling' in Java Swing.
Swing in an EVENT based application whereby 'events' are generated
by interacting with the components.
Eg: Clicking on a Button generates an 'ActionEvent' and every event
generated has an associated 'EventListener'.
Now,my question is:
a)When an event is generated,(let's say by clicking a button),
an 'event' is published,right?
That means that there is an 'Event Publisher'.
In the above case,the Button is the 'Publisher' of the event,right?
b) Who are the subscribers for the events generated?
Where do we specify the 'subscibers' to the events generated?(and once
the subscribers get the Event,the subscriber will call the methods
of the event object)
We just say
addButton.addActionListener(new ButtonHandler);
private class ButtonHandler implements ActionListener {
public void actionPerformed(ActionEvent e){
In the above code :
a) Who is the Event Publisher?
b) Who is the Event Subscriber?
No offence meant for the question.The 'event publisher' for the mouse click is the ToolKit implementation (translates the OS mouse event to a Java mouse event).
The 'event subscriber' for the mouse click on a button is typically a ButtonUI (you can add a mouse listener directly though).
The 'event publisher' for the action event is the ButtonModel (notified by the ButtonUI when the button is unpressed, etc).
The 'event subscriber' for the action event are the action listeners. -
How to use event parameters?
Hi
I've made simple eem applet for shutdown the port which trigered storm control event.
It is look like that:
event manager applet shut-storm
event storm-control
action 1.0 cli local python bootflash:shut-storm.py
and the script is
from cisco import CLI
from cisco import cli
import sys
import datetime
import time
import re
whitelist = [
"Ethernet1/1",
"Ethernet1/2"]
shlog = CLI('sh logg last 100 | i ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD | last 3',False).get_output()
pat = re.compile(r'(\d{4} \w{3} \d{2} \d\d:\d\d:\d\d) \S+ \%ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD: Traffic in port (Eth\S+|[Pp]o\S+)')
now = datetime.datetime.now()
delta = datetime.timedelta(seconds=180)
for l in shlog:
mobj = pat.match(l)
if mobj:
port = mobj.group(2)
logTimeStr = mobj.group(1)
logTimeObj = time.strptime(logTimeStr, "%Y %b %d %H:%M:%S")
logTime = datetime.datetime(*logTimeObj[:6])
if now-logTime < delta:
if port not in whitelist:
cli("conf t")
cli("interface %s" % port)
cli("shutdown")
But the python script is a bit complecs because it shoud find triggered interfece in log.
Is it possible to use event parameters? And how?
I know that they are:
sw1# sh event manager history events det
Event ID Time of Event Event Type Slot Policies
32 09/30/2013 15:40:51 storm_control active(1) shut-storm
interface = "Ethernet1/16", cause = "storm-control"Thank you Joseph.
It works.
Now the applet looks like:
event manager applet shut-storm2
event storm-control
action 1.0 cli local python bootflash:shut-storm2.py $interface
And the script:
from cisco import cli
from syslog import syslog
import sys
whitelist = [
"Ethernet1/1",
"Ethernet1/2"]
port = sys.argv[1]
if port not in whitelist:
cli("conf t")
cli("interface %s" % port)
cli("shutdown")
syslog(2, "Interface %s was shutdown due to storm conditions" % port) -
Revision: 14982
Revision: 14982
Author: [email protected]
Date: 2010-03-24 02:15:50 -0700 (Wed, 24 Mar 2010)
Log Message:
Fixing some event parameters not being forwarded.
Modified Paths:
osmf/trunk/apps/samples/framework/OSMFPlayer/src/DebuggerElementProxy.asHi,
Thanks for posting in Microsoft TechNet forums.
I will try to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thank you for your understanding and support.
Kate Li
TechNet Community Support -
Hi Regarding selection parameters and list box
Hi
This is the test Progra I am Checking for List but
When ever , After selecting from list , if press enter the value is going off,
and after executing I couldn't read P_int
when i am not geting any value into p_int.
REPORT YTEST_VINESH1.
*TYPEPOOLS
TYPE-POOLS : vrm.
*Tables
DATA DICLARATION.
DATA : name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
data: itab like lfa1 occurs 0 with header line.
DATA:P_INT1(20) TYPE C.
*SELECTION SECREEN
PARAMETER : p_int AS LISTBOX VISIBLE LENGTH 20.
*INITIALIZATION.
initialization.
select * from lfa1 up to 10 rows into table itab .
AT SELEECTION EVENTS
AT SELECTION-SCREEN OUTPUT.
name = 'P_INT'.
loop at itab.
value-key = sy-TABIX.
value-text = itab-lifnr.
APPEND value TO list.
endloop.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
CLEAR list.
*START-OF-SELECTION.
START-OF-SELECTION.
MOVE P_INT TO P_INT1.
WRITE:/ 'HAI HOW R U',P_INT1.
Thanks & Regards,
[email protected]Hi,
Check this sample code:
REPORT ZDROP_DOWN_LIST.
TABLES: LFA1.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: P_LIFNR LIKE LFA1-LIFNR AS LISTBOX VISIBLE LENGTH 20.
DATA: BEGIN OF IT_ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
LAND1 LIKE LFA1-LAND1,
NAME1 LIKE LFA1-NAME1,
END OF IT_ITAB.
INITIALIZATION.
SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO IT_ITAB .
VALUE-KEY = IT_ITAB-LIFNR.
WRITE IT_ITAB-LAND1 TO VALUE-TEXT .
CONCATENATE VALUE-KEY VALUE-TEXT
IT_ITAB-NAME1
INTO VALUE-TEXT SEPARATED BY '~'.
APPEND VALUE TO LIST.
ENDSELECT.
NAME = 'P_LIFNR'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
START-OF-SELECTION.
WRITE:/ P_LIFNR. -
Regarding Event Appraisal Functionality in Training and event management
Hi TEM gurus,
Client requirement is that an employee can give feedback for faculty daily. Suppose there is an event for 30 days and there are 5 instructors for this event. Now employee has to give feedback for all the instructor and day wise.
Is it possible for an employee to give feedback daily and for different instructors in training and event management ? How we can track the feedback given by the employee for different instructors day wise ?
I have given value as "A" in switch HAPP00 REPLA in T77S0 table. We have created different templates through OOAM.
While doing appraisal also i have to select employee individually and give event name again. Is there any way by which system can select all employees an event ID ?
kindly help me as ealry as possible.
Thanks and Best Regards
PuneetHello Puneet,
Regarding your query on appraisal for every day of the business event, I am not sure if that's possible as it's the business event appraisal we are talking of here..and not the day. But I think individiual instructor appraisal should not be a problem.
Hope this helps.
Best Regards.
Karan. -
Creation of Event Parameters With Event Creation
Hi all,
I'm triggering an event via change documents. This works very well. Now I need the old and the new value from the field, which triggers the event.
So I found a very good doucumentation on the sap help:
http://help.sap.com/saphelp_webas610/helpdata/en/72/11386ce58a11d1951f0000e82dec10/frameset.htm
I implemented all step's and I sent the event container via email to my user.
But unfortunately it dose'nt work. I never get the values in my event container.
Please help!
Regards, StephanHi Mikko,
thanks for your answer. With you help I could debug the container processing. And I found my problem.
Now I get the values in my event container.
It's a little bit strange, the change documents based on the structure CRMA_CUSTOMER_H not on the data base table CRMD_CUSTOMER_H. So I defined my object attributes for this structure and not for the data base itself.
But unfortunatly I get the next problem. When I use the event to start my workflow, the values never transferred to my workflow. I checkt the event - workflow binding again and again, but I can't find the problem.
If I send the event container to my user via the FB SWE_EVENT_MAIL the container is filled.
Any thoughts?
Regards, Stephan -
Hi guys,
i got a doubt in reports on events
how many events are there in reports.....
and what's the function of them...can any one help me plzzzz
regards
venuhi,
events:
http://www.sap-img.com/abap/events-related-to-reporting.htm
Events in Classical Reports
Initialization.
At selection-screen.
At selection-screen on <field>.
Start-of-selection.
Top-of-page.
End-of-page.
End-of-selection.
Initialization.
We can initialize the selection-screen with calculated default values under this event.
Initialization.
s_date-high = sy-datum.
s_date-low = sy-datum - 15.
Append s_date.
At selection-screen.
We can validate all the inputs on selection screen fields under this event.
At selection-screen.
If s_carrid-low is initial or s_connid-low is initial or s_date is initial.
< ... code for validation... >.
Endif.
At selection-screen on <field>.
We can validate a particular field input on selection screen under this event.
At selection-screen on s_carrid.
If s_carrid-low < > 銑H・
<・code for validation・
Endif.
Start-of-selection.
By default the program is under this event.
If any of the other event comes before
全elect・ndselect.・statements, then to break
that event, we require this S-O-S event.
Start-of-selection.
Select * from ・
・・
Endselect.
Top-of-page.
If we need some portion of the output (like
column headings) to appear in all the pages,
then we use this event.
Top-of-page.
Write:/ 舛arrier・10 舛onnection・20 船ate・
If there is no external output statement before
禅op-of-page・event, then this event will not
work.
End-of-page.
Once the cursor reaches the last line of the
page, automatically this event will be triggered.
Report Zxxx line-count 25(3).
In this case line numbers 23, 24 and 25 are
reserved for footer.
Once the cursor reaches 23rd line, this event
will be triggered.
End-of-page.
Write:/ sy-uline(75).
Write:/ 禅his is end of page:・sy-pagno.
Write:/ sy-uline(75).
End-of-selection.
This event is used for concluding part of List.
End-of-selection.
Write:/ 禅his is end of the Report・
Additional events in interactive reports
The following additional events are applicable to secondary lists.
Top-of-page during line-selection.
At line-selection.
At user-command.
These additional events are triggered when u perform some action on the basic lists.
example:
REPORT zwk22671 LINE-COUNT 40(3)
LINE-SIZE 200
NO STANDARD PAGE HEADING.
TABLES : mkpf , "MATERIAL DOCUMENT
mseg , "DOCUMENT SEGMENT : MATERIAL
t156t , "MOVEMENT TYPE TEXT
makt. "MATERIAL DESCRIPTIONS
*STRUCTURE OF INTERNAL TABLES
DATA : BEGIN OF xtab,
mblnr TYPE mkpf-mblnr , "DOCUMENT NUMBER
mjahr TYPE mkpf-mjahr , "YEAR
budat TYPE mkpf-budat , "POST DATE
blart TYPE mkpf-blart , "DOCUMENT TYPE
END OF xtab.
DATA : BEGIN OF ytab,
mblnr TYPE mseg-mblnr , "DOCUMENT NUMBER
mjahr TYPE mseg-mjahr , "YEAR
zeile TYPE mseg-zeile , "ITEM NUMBER
bwart TYPE mseg-bwart , "MOVEMENT TYPE
btext TYPE t156t-btext , "MOVEMENT DESCRIPTION
matnr TYPE mseg-matnr , "MATERIAL NUMBER
maktx TYPE makt-maktx , "MATERIAL DESCRIPTION
meins TYPE mseg-meins , "UNIT OF MEASURE
menge TYPE mseg-menge , "QUANTITY
dmbtr TYPE mseg-dmbtr , "AMOUNT
END OF ytab.
*INTERNAL TABLE DECLARATION
DATA : i_tab1 LIKE STANDARD TABLE OF xtab WITH HEADER LINE. "INTERNAL TABLE 1 : CONTAINS MATERIAL DETAILS
DATA : i_tab2 LIKE STANDARD TABLE OF ytab WITH HEADER LINE. "INTERNAL TABLE 2 : CONTAINS ITEMWISE MATERIAL DETAILS
*VARIABLES
DATA : v_color TYPE sy-tabix , "FOR SETTING COLOR FORMATS DURING GENERATING REPORT
v_field(20) , "FOR STORING THE CLICKED FIELD NAME
v_value(20) , "FOR STORING THE CLICKED FIELD VALUE
v_mblnr TYPE mkpf-mblnr , "FOR VALIDATING DOCUMENT NUMBER
v_mjahr TYPE mkpf-mjahr , "FOR VALIDATING DOCUMENT YEAR
v_bwart TYPE mseg-bwart , "FOR VALIDATING MOVEMENT TYPE
v_matnr TYPE mseg-matnr . "FOR VALIDATING MATERIAL NUMBER
**SELECTION-SCREEN
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_mblnr FOR mkpf-mblnr , "DOCUMENT NUMBER
s_mjahr FOR mkpf-mjahr OBLIGATORY, "DOCUMENT YEAR
s_bwart FOR mseg-bwart NO INTERVALS NO-EXTENSION, "MOVEMENT TYPE
s_matnr FOR mseg-matnr . "MATERIAL NUMBER
SELECTION-SCREEN : END OF BLOCK blk1.
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
PERFORM validation. "PERFORMS VALIDATION OF SELECTION-SCREEN FIELDS
*TOP-OF-PAGE
TOP-OF-PAGE.
PERFORM header. "CREATES HEADER FOR THE BASIC LIST
*END-OF-PAGE
END-OF-PAGE. "CREATES FOOTER FOR THE BASIC AND SECONDARY LIST
PERFORM footer.
*START-OF-SELECTION
START-OF-SELECTION.
PERFORM generation_basic. "GENERATES REPORT FOR BASIC LIST WHICH CONTAINS DOCUMENT NO , DOCUMENT YEAR
"POST DATE , DOCUMENT TYPE.
*END-OF-SELECTION
END-OF-SELECTION.
PERFORM report_basic. "DISPLAY REPORT FOR BASIC LIST
*AT LINE-SELECTION
AT LINE-SELECTION.
PERFORM generation_secondary. "GENERATES REPORT FOR SECONDARY LIST BASED ON THE DOCUMENT NUMBER AND DOCUMENT YEAR
"WHICH CONTAINS DOCUMENT NO , YEAR , ITEM NO , MOVEMENT TYPE , MOVEMENT DESCRIPTION ,
"MATERIAL NUMBER , MATERIAL DESC , UNIT OF MEASURE , QUANTITY AND AMOUNT
*TOP-OF-PAGE DURING LINE-SELECTION
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header_secondary. "CREATES HEADER FOR THE SECONDARY LIST
*AT USER-COMMAND
AT USER-COMMAND.
PERFORM user_secondary. "SUBROUTINE FOR HANDLING USER EVENTS
FORM validation .
*VALIDATING MATERIAL DOCUMENT NUMBER
SELECT SINGLE mblnr
INTO v_mblnr
FROM mkpf
WHERE mblnr IN s_mblnr.
IF sy-subrc NE 0.
MESSAGE 'ENTER CORRECT DOCUMENT NUMBER' TYPE 'E'.
ENDIF.
*VALIDATING MATERIAL DOCUMENT YEAR
SELECT SINGLE mjahr
INTO v_mjahr
FROM mkpf
WHERE mjahr IN s_mjahr.
IF sy-subrc NE 0.
MESSAGE 'ENTER CORRECT MATERIAL DOCUMENT YEAR' TYPE 'E'.
ENDIF.
*VALIDATING MOVEMENT TYPE
SELECT SINGLE bwart
INTO v_bwart
FROM mseg
WHERE bwart IN s_bwart.
IF sy-subrc NE 0.
MESSAGE 'ENTER CORRECT MOVEMENT TYPE' TYPE 'E'.
ENDIF.
*VALIDATING MATERIAL NUMBER
SELECT SINGLE matnr
INTO v_matnr
FROM mseg
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE 'ENTER CORRECT MATERIAL NUMBER' TYPE 'E'.
ENDIF.
ENDFORM. " VALIDATION
FORM header .
WRITE :/30 'MATERIAL DOCUMENTS' COLOR 1. "TITLE OF BASIC LIST
WRITE :/1(89) sy-uline.
FORMAT COLOR 1.
WRITE :/1 sy-vline ,
3 'DOCUMENT NUMBER' ,
23 sy-vline ,
25 'YEAR' ,
45 sy-vline ,
47 'POST DATE' ,
67 sy-vline ,
69 'DOCTYP' ,
89 sy-vline .
FORMAT RESET.
WRITE :/1(89) sy-uline.
ENDFORM. " HEADER
FORM footer .
IF sy-lsind EQ 0. "CHECKS WHICH LIST IS IT BASIC LIST OR SECONDARY (AND NO. OF SECONDARY LIST)
WRITE :/1(89) sy-uline.
ELSEIF sy-lsind EQ 1.
WRITE :/1(192) sy-uline.
ENDIF.
ENDFORM. " FOOTER
FORM generation_basic .
SELECT mkpf~mblnr "DOCUMENT NUMBER
mkpf~mjahr "DOCUMENT YEAR
mkpf~budat "POST DATE
mkpf~blart "DOCUMENT TYPE
INTO TABLE i_tab1
FROM mkpf INNER JOIN mseg ON mkpfmjahr EQ msegmjahr AND
mkpfmblnr EQ msegmblnr
WHERE mkpf~mblnr IN s_mblnr
AND mkpf~mjahr IN s_mjahr
AND mseg~bwart IN s_bwart
AND mseg~matnr IN s_matnr.
IF sy-subrc NE 0.
WRITE :/ 'MATERIAL DATA NOT FOUND'.
ENDIF.
DELETE ADJACENT DUPLICATES FROM i_tab1 COMPARING mblnr mjahr.
ENDFORM. " GENERATION_BASIC
FORM report_basic .
LOOP AT i_tab1.
v_color = sy-tabix MOD 2.
IF v_color EQ 0.
FORMAT COLOR 1 INTENSIFIED OFF.
ELSE.
FORMAT COLOR 2 INTENSIFIED OFF.
ENDIF.
WRITE :/1 sy-vline ,
3 i_tab1-mblnr ,
23 sy-vline ,
25 i_tab1-mjahr ,
45 sy-vline ,
47 i_tab1-budat ,
67 sy-vline ,
69 i_tab1-blart ,
89 sy-vline .
HIDE : i_tab1-mblnr , i_tab1-mjahr. "STORING THE VALUE OF FIELDS CLICKED IN SYSTEM AREA
ENDLOOP.
FORMAT RESET.
WRITE :/1(89) sy-uline.
ENDFORM. " REPORT_BASIC
FORM generation_secondary .
IF sy-lsind EQ 1.
SET PF-STATUS 'DISPLAY'.
GET CURSOR FIELD v_field VALUE v_value. "GET THE FIELD VALUE AND NAME WHERE THE CURSOR WAS CLICKED
CASE v_field.
WHEN 'I_TAB1-MBLNR'. "DISPLAYS SECONDARY LIST ONLY IF DOCUMENT NUMBER IS CLICKED
SELECT mseg~mblnr "DOCUMENT NUMBER
mseg~mjahr "DOCUMENT YEAR
mseg~zeile "ITEM NUMBER
mseg~bwart "MOVEMENT TYPE
t156t~btext "MOVEMENT DESCRIPTION
mseg~matnr "MATERIAL NUMBER
makt~maktx "MATERIAL DESCRIPTION
mseg~meins "UNIT OF MEASURE
mseg~menge "QUANTITY
mseg~dmbtr "AMOUNT
INTO TABLE i_tab2
FROM ( ( mseg INNER JOIN t156t
ON msegbwart EQ t156tbwart )
INNER JOIN makt
ON msegmatnr EQ maktmatnr )
WHERE mseg~mblnr EQ i_tab1-mblnr
AND mseg~mjahr EQ i_tab1-mjahr
AND t156t~spras EQ sy-langu
AND makt~spras EQ sy-langu.
DELETE ADJACENT DUPLICATES FROM i_tab2 COMPARING mblnr mjahr.
WHEN OTHERS.
MESSAGE 'SELECT DOCUMENT NUMBER' TYPE 'E'.
ENDCASE.
LOOP AT i_tab2.
v_color = sy-tabix MOD 2.
IF v_color EQ 0.
FORMAT COLOR 1 INTENSIFIED OFF.
ELSE.
FORMAT COLOR 2 INTENSIFIED OFF.
ENDIF.
WRITE :/1 sy-vline ,
3 i_tab2-mblnr ,
12 sy-vline ,
14 i_tab2-mjahr ,
19 sy-vline ,
21 i_tab2-zeile ,
30 sy-vline ,
32 i_tab2-bwart ,
40 sy-vline ,
42 i_tab2-btext ,
72 sy-vline ,
74 i_tab2-matnr ,
94 sy-vline ,
96 i_tab2-maktx ,
146 sy-vline ,
148 i_tab2-meins ,
153 sy-vline ,
155 i_tab2-menge ,
170 sy-vline ,
172 i_tab2-dmbtr ,
192 sy-vline .
ENDLOOP.
WRITE :/1(192) sy-uline.
FORMAT RESET.
ELSEIF sy-lsind EQ 2.
GET CURSOR FIELD v_field VALUE v_value. "GET THE FIELD VALUE AND NAME WHERE THE CURSOR WAS CLICKED
CASE v_field.
WHEN 'I_TAB2-MBLNR'. "DISPLAYS SECONDARY LIST ONLY IF DOCUMENT NUMBER IS CLICKED
SET PARAMETER ID : "SETTING PARAMETER ID FOR DOCUMENT NUMBER AND YEAR.
'MBN' FIELD i_tab2-mblnr ,
'MJA' FIELD i_tab2-mjahr.
CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN. "CALLING TRABSACTION CODE 'MBO3'.
WHEN OTHERS.
MESSAGE 'SELECT DOCUMENT NUMBER' TYPE 'E'.
ENDCASE.
ENDIF.
ENDFORM. " GENERATION_SECONDARY
FORM header_secondary .
WRITE :/50 'ITEMWISE MATERIAL DOCUMENTS' COLOR 1.
WRITE :/1(192) sy-uline.
FORMAT COLOR 1.
WRITE :/1 sy-vline ,
3 'DOCUMENT NO' ,
12 sy-vline ,
14 'YEAR' ,
19 sy-vline ,
21 'ITEM NO.' ,
30 sy-vline ,
32 'MOV TYP' ,
40 sy-vline ,
42 'MOV DESCRIPTION' ,
72 sy-vline ,
74 'MATERIAL NO' ,
94 sy-vline ,
96 'MATERIAL DESCRIPTION' ,
146 sy-vline ,
148 'UOM' ,
153 sy-vline ,
155 'QUANTITY' ,
170 sy-vline ,
172 'AMOUNT' ,
192 sy-vline .
WRITE :/1(192) sy-uline.
FORMAT RESET.
ENDFORM. " HEADER_SECONDARY
*FORM user_secondary .
IF sy-ucomm EQ 'DISPLAY'. "EXECUTES ONLY IF 'DISPLAY DOCUMENTS' ITEM IS CLICKED ON APPLICATION TOOL BAR.
IF sy-lsind EQ 2.
GET CURSOR FIELD v_field VALUE v_value. "GET THE FIELD VALUE AND NAME WHERE THE CURSOR WAS CLICKED
CASE v_field.
WHEN 'I_TAB2-MBLNR'. "DISPLAYS SECONDARY LIST ONLY IF DOCUMENT NUMBER IS CLICKED
SET PARAMETER ID :
'MBN' FIELD i_tab2-mblnr ,
'MJA' FIELD i_tab2-mjahr.
CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN.
WHEN OTHERS.
MESSAGE 'SELECT DOCUMENT NUMBER' TYPE 'E'.
ENDCASE.
ENDIF.
LEAVE PROGRAM.
ENDIF.
ENDFORM. " USER_SECONDARY
Maybe you are looking for
-
Can I force my phone to make calls using WiFi, even when wireless is available?
When I was in the UK a couple years ago I could make calls back to USA using WiFi, because the wireless service was incompatible with my phone. When I was in the Dominican Republic last year, even though I used GrooveIP and Google Voice, I came home
-
Flex & CF: unable to open...
Connecting flex to coldfusion cfc via a remote object. The error " unable to open '\CFusionMX7\wwwroot\WEB-INF\flex\services-config.xml' " appears. The file exist with its coldfusion-destination. I managed to connect flex to coldfusion on another com
-
What I will be trying to acheive is to read from an XML file that will be located in my assets folder in my Project directory. So as I will try to use the E4X concepts for obtaining data from XML, I started to write my code but am getting an error as
-
My ipod isn't displayed in my computer
before when i connected my ipod, both itunes and the computer recognized the ipod. An extra disc appeared in My Computer (F:), but now there are no F: when i connect the ipod. but itunes works perfectly fine. what can i do, so i can bet back the extr
-
Why does synching take so long on iphone 5
synching takes a long time on Iphone 5