How to retrieve the link's label with HTML Editor kit?
Hi all,
I need to retrieve the label that is on a HREF html attribute.
In other words I need to retreive the words "Home Page" from
this snippet:
<b>Home Page</b>
I have found tutorials that show how to extract the link itself
but not the label ....:-(
can anybody help me?
Thanks
Francesco
Hi,
if you have a HTMLDocument you can look into the element structure of this document to find a certain A tag as follows /**
* find the next link attribute from a given element upwards
* through the element hierarchy
* @param elem the element to start looking at
* @return the link attribute found, or null, if none was found
public static Element findLinkElementUp(Element elem) {
Element e = null;
Object linkAttr = null;
Object href = null;
while((elem != null) && (linkAttr == null)) {
e = elem;
linkAttr = elem.getAttributes().getAttribute(HTML.Tag.A);
if(linkAttr != null) {
href = ((AttributeSet) linkAttr).getAttribute(HTML.Attribute.HREF);
elem = elem.getParentElement();
if(linkAttr != null && href != null) {
return e;
else {
return null;
}When this method returns an element, its start and end can be used to extract the link text.
Ulrich
Similar Messages
-
How to retrieve the link clicked inside an iframe ?
Hi all..
I have a JSP where i have used an iframe to display the URL's dynamically. (URL's are being passed at run time) I want to retrieve the link's URL (i.e. href attribute value ) when user clicks on the link displayed inside iframe.
Say for e.g. www.yahho.com is the URL displayed inside the iframe and now if i click on any of the link of page, i want to retrieve the href before the navigation happens.
Is it possible to retrieve the href ? If so how to forward this href to my action class where i do further work.
Any solutions in this regard ?
Thanks in advance..
PrasadThis is probably a javascript question rather than JSP, seeing as you are doing detection at client side.
No it is not. Or at least not directly.
For security reasons, browsers have now disabled "[cross-frame-scripting|http://www.google.com/search?q=cross-frame-scripting&meta=&btnG=Google+Search]"
indirectly you could set up a "proxy-server" type setup. Make all web requests to that "proxy". The proxy issues a real web request, and retrieves the actual data to stream, but could also do extra processing. Maybe. But basically you would have to intercept every single web request going out. -
Printing the data in "Textarea with HTML editor" item in APEX as pdf
Hello,
I have a requirement which goes like this.
The user enters data in the HTML editor in APEX. All the tools available in the HTML toolbar will be used (eg. bulleted points, tables etc.). This data is stored in a single cell in the database. This data needs to be generated as a pdf for printing. We have Apache FOP installed as well.
When I try to create a report region with this data and export it as pdf, the html tags are not considered. For eg. the table in the HTML editor doesn't appear as a table in the pdf, only the text appears.
Let me know if such a transformation is possible. Also, can any other tool perform this??
Note: The data in the HTML editor may not be in a fixed template. Whatever is entered there has to be converted.
Thanks in advance !!The strip HTML attribute is set to "No" already. If you understood clearly, I need to convert the entire data in a HTML editor item to pdf. The data is stored in a single cell as HTML tags in the database. The data may inturn contain HTML tables as well. These HTML tables are not captured in the pdf, only the text within the tables are displayed.
-
How to delete the Data Points label with a crosstab layout
Hi, just a question.
I created a report which uses a crosstab layout; so...I have the Company Name on the left, Status Code above and the Count(tickets) as Data Points.
As soon as I put the Count(tickets) inside the report, the label "Data Points: Incident Id Count appears above just at the bottom of the Status Code
Is there a way to avoid this tedious label ?
As workaround, I changed the Data Points' format heading (text and background) in such a way to see only a Grey space...but this is not so useful (from the customer side...)
I also looked for inside the crosstab layout properties...but I didn't found nothing.....
Any help will be appreciate
AlexWell, I think you are out of luck. You are basically saying you want to control when you have a column heading and when you don't want to have a column heading. Most of us users do want column headings in our reports. In fact I have a hard time trying to figure out why you don't want a column heading. How are the report users going to know what the numbers in the column mean if you don't have a heading on the column? Maybe the initial users of the report know, but what happens when they leave and someone else takes over their duties? I would suggest putting in an enhancement request for Discoverer to give you the option to not display a column heading, if you really want something like this. This needs to be at the workbook level, I am thinking.
John Dickey -
How to get the color value matching with HTML?
Hello,
I'd like to have the color value based on the HTML pattern using JS like InDesign file is having the value c=80,M=20,Y=40,K=20 and getting the HTML pattern as #29a37a during HTML export.
Please advise to get the same type of value for all the colors in InDesign without doing HTML export using JS.
Thanks,
Praveen@Gejaraja – read the following to get an idea:
Harbs
Hexadecimal Swatches in InDesign
http://in-tools.com/article/scripts-blog/hexadecimal-swatches-in-indesign/
Uwe -
How to retrieve the path and the name of the destination file in a link annotation
Hi,
In C++:
How to retrieve the path and the name of the destination file in a link annotation and a Launch action.
Sample of my code:
//Determine if the annotation is a Link annotation
if (PDAnnotGetSubtype(annot) == ASAtomFromString("Link")) {
//Determine if the action is a Launch action
if (PDActionGetSubtype(action) == ASAtomFromString("Launch")) {
// What is the method ?
Regards
David GIn general, get the annotation as a Cos object and examine it, in
accordance with the PDF Reference.
Aandi Inston -
How to retrieve the user input in One Step Screenflow
Hello all,
I am new in KM. I would like to ask in One Step Screenflow, I have add a inputfield into the ConfirmComponent. How can I retrieve the user input?
public IRenderingEvent execute(IScreenflowData sfd) throws WcmException
inp.setLabel(new Label("Delegation:"));
ConfirmComponent cc = new ConfirmComponent(ConfirmComponent.OK_CANCEL,this.context.getLocale(),inp);
String sRid = (String)this.values.get(0);
RID rid = RID.getRID(sRid, null);
OneStepScreenflow oscf = new OneStepScreenflow(sfd,this.getAlias(),rid,cc);
return oscf.execute();
In the IRenderingEvent , How to retrieve the user input?
public IRenderingEvent execute(IResource res, Event event ) throws WcmException
if (event instanceof ConfirmEvent)
ConfirmEvent cce = (ConfirmEvent)event;
if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice()))
return new InfoEvent(Status.OK, "Done !");
else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice()))
return ConfirmComponent.onNo(event, res.getContext().getLocale());
else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice()))
return ConfirmComponent.onCancel(event, res.getContext().getLocale());
return new InfoEvent(Status.ABORT, "Aborted.");
Many Thanks,
SunnyHello yoga,
Many Many thanks for your reply again.
I have just try the class in the thread link.
There is a error
"The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project."
The errors occurs because of "extends OneStepComponent"
public final class NewConfirmInputComponent extends OneStepComponent
Where can find javax.servlet.http.HttpServletRequest to include it in my classpath?
Thanks
Sunny -
How to retrieve the values from a table if they differ in Unit of Measure
How to retrieve the values from a table if they differ in Unit of Measure?
If no data is read
- Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
If no quanity in result internal table
- There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
- - Remove the CORRESPONDING, so quantity will fill the first field adqntp1. ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
- - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
* Fill the internal table
SELECT msehi adqntp
INTO TABLE internal table
FROM lipso2
WHERE vbeln = wrk_doc1
AND msehi IN ('KL','K15','MT').
* If required move the read quantity in the appropriate column.
LOOP AT internal_table ASSIGNING <fs>.
CASE <fs>-msehi.
WHEN 'K15'.
<fs>-adqnt2 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
WHEN 'MT'.
<fs>-adqnt3 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
ENDCASE.
ENDLOOP.
- You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
Regards,
Raymond -
How to retrieve the data from SAP-BAPI by using VB Code
Hi ,
I am new to BAPI.
V have created an application in Visual Basic with the following fields
EmpNo , EmpName, Addr1, Addr2, City and Phone (Only for Test)
We have written the code for SAVING the data into SAP. Already we have
constructed a table with the respective fields in SAP.
For that we ourself created our own BAPI Structure / Function Group /
Function Module/ Business Object - RELEASED related elements.
1)Established the connection successfully.
2)Stored the data into SAP Successfully and v r in need of
3)HOW TO RETRIEVE THE DATA FROM SAP (USING GETLIST.....GETDETAIL....)
Following is the code :
'BAPI Structure : ZBAPIEMP
'Function Group : ZBAPIEMP
'Function Module : ZBAPI_EMP_CREATEFROMDATA
'Business Object : ZBAPIEMP
'Function Module : ZBAPI_EMP_GETLIST
Dim bapictrl As Object
Dim oconnection As Object
Dim boEmp As Object
Dim oZEmp_Header As Object
Dim oImpStruct As Object
Dim oExpStruct As Object
Dim oreturn As Object
Dim x As String
Private Sub Form_Load()
Set bapictrl = CreateObject("SAP.BAPI.1")
Set oconnection = bapictrl.Connection
oconnection.logon
Set boEmp = bapictrl.GetSAPObject("ZBAPIEMP")
Set oZEmp_Header = bapictrl.DimAs(boEmp, "CreateFromData", "EmployeeHeader")
Set oImpStruct = bapictrl.DimAs(boEmp, "GetList", "EmployeeDispStruct")
End Sub
Private Sub cmdSave_Click()
oZEmp_Header.Value("EMPNO") = txtEmpNo.Text
oZEmp_Header.Value("EMPNAME") = txtEmpName.Text
oZEmp_Header.Value("ADDR1") = txtAddr1.Text
oZEmp_Header.Value("ADDR2") = txtAddr2.Text
oZEmp_Header.Value("CITY") = txtCity.Text
oZEmp_Header.Value("PHONE") = txtPhone.Text
boEmp.CreateFromData EmployeeHeader:=oZEmp_Header, Return:=oreturn
x = oreturn.Value("Message")
If x = "" Then
MsgBox "Transaction Completed!..."
Else
MsgBox x
End If
End Sub
Private Sub cmdView_Click()
End Sub
COULD ANYBODY GUIDE ME, HOW TO RETRIEVE THE DATA FROM BAPI, FOR THE WRITTEN CODE.I didn't seen any other answers but here's how it's been done previously in our organization for a custom BAPI. In this example, we give material and language to return the part description. It's not specific to your project but may give you ideas..
-Tim
Option Compare Database
Dim SAPLOGIN As Boolean
Dim FunctionCtrl As Object
Dim SapConnection As Object
Sub SAPLOGOUT()
On Error GoTo LogoutFehler
SapConnection.logoff
SAPLOGIN = False
Exit Sub
LogoutFehler:
If Err.Number = 91 Then
Exit Sub
Else
MsgBox Err.Description, vbCritical, "Fehler-Nr." & CStr(Err.Number) & " bei SAP-Logout"
End If
End Sub
Function SAPLOG() As Boolean
'Verbindungsobjekt setzen (Property von FunctionCtrl)
Set FunctionCtrl = CreateObject("SAP.Functions")
Set SapConnection = FunctionCtrl.Connection
'Logon mit Initialwerten
SapConnection.Client = "010"
SapConnection.Language = "EN"
SapConnection.System = "PR1"
SapConnection.SystemNumber = "00"
'SapConnection.Password = ""
SapConnection.GroupName = "PR1"
SapConnection.HostName = "168.9.25.120"
SapConnection.MessageServer = "168.9.25.120"
If SapConnection.Logon(0, False) <> True Then 'Logon mit Dialog
Set SapConnection = Nothing
DoCmd.Hourglass False
MsgBox "No connection to SAP R/3 !"
SAPLOGIN = False
SAPLOG = False
Exit Function
End If
SAPLOG = True
End Function
Function MatDescr(MatNr As String)
Dim func1 As Object
Dim row As Object, X As Integer, ErsteNr As String
Dim DatensatzZähler As Long
Dim RowField(1 To 50, 0 To 1) As String, RowLine As Long
If Not SAPLOGIN Then
If Not SAPLOG() Then
MsgBox "No connection to SAP !", 16
SAPLOGOUT
Exit Function
End If
End If
' Instanziieren des Function-Objektes
Set func1 = FunctionCtrl.Add("Z_BAPI_READ_MAKT")
' Export-Paramter definieren
func1.exports("MATNR") = MatNr
func1.exports("SPRAS") = "EN"
DoEvents
If Not func1.call Then
If func1.exception <> "" Then
MsgBox "Communication Error with RFC " & func1.exception
End If
DoCmd.Hourglass False
SAPLOGOUT
Exit Function
Else
MatDescr = func1.imports("MAKTX")
End If
If MatDescr = "" Then
MatDescr = "PART NO. NOT FOUND"
End If
End Function -
How to get the link of already archived document
Dear all,
How to get the link of already archivied document. for example i have a sales order for which subsequent documents have been archived. now i want to get the link of subsequent document.
please give some solution
Thanks in advance
Thanks,
Hemachandran.Hemachandran,
The archiving object for sales order is SD_VBAK. If you run the program S3VBAKAU by transaction se38 and search based on the document numbers ( as you mentioned it is the preceeding document numbers to the current document), you will be able to retrieve the information regarding the previous sales orders.
More information on the sales order archiving object can be found at,
http://help.sap.com/saphelp_45b/helpdata/en/a9/55c7b690a111d1a5510000e82deaaa/content.htm
Sojan
<<text removed by moderator>>
Edited by: Matt on Nov 16, 2008 5:08 PM - Do not request points -
How to retrieve the java object in a proxy service in osb -- Plz help
Hi all,
I have a singleton java class which runs whenever the weblogic server gets started and store the output in its object. I need to access this java object from a proxy service in osb.
We tried using java call out and retrieved that object but we couldn't know how to parse that object into XML.
We are not sure of using the java call out in osb to solve this purpose because whenever we use a java callout, that particular java code will run which is not the case of singleton class.
So kindly help us how to retrieve the java object which holds the output without running the java code every time because its already run and holding the output in its object.
Regards
Prabhuhere the doc http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656
but I guess you are already at the stage of getting a POJO in a first Java Callout and passing the POJO to a second Java Callout, which should then return it to OSB as a XMLObject.
My recommendation is to write a Java function which returns a XMLObject and uses a XMLCursor to populate it with the values of the POJO.
An XMLObject returned to the OSB is automatically transformed in a "XML" variable (which in reality is represented as a XMLObject in the Pipeline context)
Here some code sample:
http://www.javamonamour.org/2010/09/how-to-create-xmlobject-using-xmlcursor.html -
How to change the text of label dynamically
Hi all,
I have done a dynpro program.It requires to implement the dynamically display the label text, for example: there is a label, sometimes, we want to display "Purchase Order" and sometimes we want to display "Sales Order". Can anyone tell me how to change the text of label according to my requirements? thanks in advance!Hi Wei,
AS of now you will not be able to change the Text Field ( Label ) dynamically or at runtime. This is a limitation.Refer to this link:
http://help.sap.com/saphelp_nw04/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
But, there is a way around.
You can make a text field Visible / Invisible based on your program logic. So, based on what you want, you can process a module which will take care of that.
Have a look at these DEMO Code. You can have a good idea to implement the logic.
DEMO_DYNPRO_MODIFY_SCREEN - Demonstration of Dynamic Screen Modifications
Thanks,
Samantak. -
How to cooperate the current mail system with Sun Java Commnication Suite 5
Dear all and Shane,
Excuse me for bothering you again.
Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5. I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.
Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5.
My plan is as following
1. Sun Java Communication suites 5 server ( I called it comms5 ) will be in DMZ zone and will open the necessary ports in firewall.
2. I will create more than six sub domain name in Sun Delegate server and the necessary accounts within these domain names.
3. All messages will be transmitted via Postfix and clients will retrieve from Courier-IMAP
4. All Clients included other branch offices will use different mail clients to share their calendars, contacts via COMMS5 ( But how will COMMS handle the messages such like invitation ? )
Any suggestions will appreciate.
PS: Is it possible to classify the contacts in outlook address book ?
For example, when user click the receiver, it will show like as following
GLOBAL ADDRESS BOOK
--Director
--and so on
----CN.BRANCH OFFICE
-----------CN01 EMAIL ADDRESS
-----------CN02 EMAIL ADDRESS
-----------CN03 EMAIL ADDRESS
and so on
----JP.BRANCH OFFICE
-----------JP01 EMAIL ADDRESS
-----------JP02 EMAIL ADDRESS
-----------JP03 EMAIL ADDRESS
and so on
----TW.BRANCH OFFICE
and Due to the user account is located in CN.BRANCH OFFICE, it will extend the CN.BRANCH OFFICE contacts level.
Excuse me for bad English, hope you can understand it.
Best Regards,
BruceDogz wrote:
Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5.
I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.Getting your current mail system to 'co-operate' in this way will require more time then simply migrating the accounts of users on the current mail system to the comm-suite-5 installation and making use of UWC for Webmail access and ClamAV/SpamAssassin integration within the messaging MTA.
Also the use of Outlook Connector with a non-Sun IMAP backend isn't supported, nor is the use of a non-Sun IMAP backend possible with UWC.
Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5. Once again I should remind you that CentOS is not a supported platform for comm-suite-5
Regards,
Shane. -
How to get the link report of a swf file to the set of clases
He But How to get the link Report of the SwF File
Here are some links with additional information:
http://stackoverflow.com/questions/185252/optimizing-flex-when-multiple-modules-are-used
http://livedocs.adobe.com/flex/3/html/help.html?content=modular_4.html
http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
If this post answers your question or helps, please mark it as such. -
How to get the link between mara, ausp, cawn and cawnt tables
hello ABAPERS
i have got a requiremet in that i have to get the relation .
how to get the link between mara, ausp, cawn and cawnt tables and also type how can we get link between char value and char description in cawn and cawnt tables through ausp and mara tables.
I would be very thankful for ur help in advance.
Thanks & Regards.
soniHi,
Sample report using the linkage between tables;
report batch_char no standard page heading
line-size 132
line-count 58(1)
message-id mm.
Report by Batch Characteristic *
Description : Report by Batch Characteristic *
Declaration for Tables
tables: mara, " Material Master
mard, " Storage Location Data for Material
t001w, " Plants/Branches
t001l, " Storage Locations
cabn, " Characteristics
inob. " Link between Internal Number and Object
Declaration for Constants
constants : c_klart like ausp-klart value '023', " Class Type
c_obtab like inob-obtab value 'MCH1', " Database Table
c_flag type c value 'X', " Flag
c_c23 type i value '23', " Ratio
Constants for Ratio Categories
c_13 type p decimals 2 value '13.00', " For Ratio 13
c_1499 type p decimals 2 value '14.99', " For Ratio 14.99
c_15 type p decimals 2 value '15.00', " For Ratio 15
c_1699 type p decimals 2 value '16.99', " For Ratio 16.99
c_17 type p decimals 2 value '17.00', " For Ratio 17
c_1899 type p decimals 2 value '18.99', " For Ratio 18.99
c_19 type p decimals 2 value '19.00', " For Ratio 19
c_2099 type p decimals 2 value '20.99', " For Ratio 20.99
c_21 type p decimals 2 value '21.00', " For Ratio 21
c_2299 type p decimals 2 value '22.99', " For Ratio 22.99
c_23 type p decimals 2 value '23.00', " For Ratio 23
c_g23(4) type c value '>=23', " For Ratio >=23
c_ratio(5) value 'RATIO', " For Ratio
Constants for Storing Selected item field information
c_cursor1(15) value 'I_OUTPUT1-MEINS', " For Selected Base
" Unit of Measure
c_cursor2(15) value 'I_OUTPUT1-MATNR', " For Selected Base
" Material Number
c_cursor3(15) value 'I_OUTPUT1-MAKTX', " For Selected Base
" Material Des.
c_cursor4(15) value 'I_OUTPUT1-CLABS', "For Selected Base
" Stock Value
c_cursor5(15) value 'I_OUTPUT1-ATFLV', " For Selected Base
" Char.Value (Ratio)
c_cursor6(5) value 'C_G23'.
Declaration for Global Variables
data : g_exit type c, " Flag
g_clabs1(16) type c, " Quantity
g_clabs(18) type c, " Quantity
g_cursor(15) type c, " Cursor field name
g_matnr type mara-matnr, " Material Number
g_werks type mchb-werks, " Plant
g_atinn(30) type c. " Character.
Declaration for Internal tables
Internal table to hold Batch Stock data
data : begin of i_mchb occurs 0,
matnr like mchb-matnr, " Material Number
werks like mchb-werks, " Plant
lgort like mchb-lgort, " Storage Location
charg like mchb-charg, " Batch Number
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Unit of measure
atflo like ausp-atflv, " Char.Value (Ratio)
atflv like ausp-atflv, " Char.Value (Ratio)
end of i_mchb.
Internal table to hold Secondary List data
data : begin of i_mchb1 occurs 0,
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
lgort like mchb-lgort, " Storage Location
charg like mchb-charg, " Batch Number
atinn like ausp-atinn, " Char.Value
clabs like mchb-clabs, " Stock Value
atflo like ausp-atflv, " Char.Value (Ratio)
atflv like ausp-atflv, " Char.Value (Ratio)
end of i_mchb1.
Internal table to get the Plant Name
data : begin of i_plant occurs 0,
werks like t001w-werks, " Plant
name1 like t001w-name1, " Name
end of i_plant.
Internal table to get the Material Description
data : begin of i_makt occurs 0,
matnr like makt-matnr, " Material
maktx like makt-maktx, " Description
end of i_makt.
Internal table to hold AUSP data
data : begin of i_ausp occurs 0,
objek like ausp-objek, " Object No
atinn like cabn-atinn, " Characteric value
atflv like ausp-atflv, " Characteristic Value
end of i_ausp.
Internal table to hold output data
data : begin of i_output occurs 0,
atinn like cabn-atinn, " Characteric value
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
atnam like cabn-atnam, " Characteristic
atflv like ausp-atflv, " Char.Value (Ratio)
name1 like t001w-name1, " Plant Description
maktx like makt-maktx, " Material Description
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Base Unit of Measure
end of i_output.
Internal table to hold final Output data
data : begin of i_output1 occurs 0,
atinn like cabn-atinn, " Characteric value
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
atnam like cabn-atnam, " Characteristic
atflv(32) type c, " Char.Value (Ratio)
name1 like t001w-name1, " Plant Description
maktx like makt-maktx, " Material Description
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Base Unit of Measure
end of i_output1.
Selection screen
selection-screen begin of block b1 with frame title text-001.
select-options: s_werks for t001w-werks obligatory, " Plant
s_lgort for t001l-lgort, " Stor.Location
s_matnr for mara-matnr obligatory, " Material No
s_atinn for cabn-atinn. " Character.
selection-screen end of block b1.
At selection screen
at selection-screen.
Validation of Selection Screen Fields
perform validate_screen.
Start of selection
start-of-selection.
Get the Material and Batch Stock data from MARA and MCHB Tables
perform get_mat_stock_data.
Get the Material Group Text and Plant Name from T023T and T001W Tables
perform get_plant_grp_data.
Append the data into final Output Internal Table after getting the
Characteristic Values data from INOB and AUSP Tables
perform append_final_data.
Processing if the Characteristics contain 'RATIO'
perform collect_ratio.
End-of-Page
end-of-page.
write /1(125) sy-uline.
End of selection
end-of-selection.
if g_exit <> c_flag.
Display the Report Output data
perform display_report.
endif.
Top-of-Page
top-of-page.
Write the Report and Column Headings
perform get_headings.
at line-selection
at line-selection.
if sy-lsind = 1.
perform display_batch.
endif.
Top of page during line-selection
top-of-page during line-selection.
perform heading_seclist.
Form validate_screen
Validation of Selection Screen fields
form validate_screen.
Validation of Plant
clear t001w.
if not s_werks[] is initial.
select werks
into t001w-werks
from t001w
up to 1 rows
where werks in s_werks.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Plant'(002).
endif.
endif.
Validation of Material Number
clear mara.
if not s_matnr[] is initial.
select matnr
into mara-matnr
from mara
up to 1 rows
where matnr in s_matnr.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Material'(003).
endif.
endif.
Validation of Storage Location
clear t001l.
if not s_lgort[] is initial.
select lgort
into t001l-lgort
from t001l
up to 1 rows
where lgort in s_lgort.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Storage Location'(004).
endif.
endif.
Validation of Characteristic Value
clear cabn.
if not s_atinn[] is initial.
select atinn
into cabn-atinn
from cabn
up to 1 rows
where atinn in s_atinn.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Characteristic Value'(005).
endif.
endif.
Validation of Plant, Material and Storage Location
clear mard.
select matnr werks lgort
into (mard-matnr, mard-werks, mard-lgort)
from mard
up to 1 rows
where matnr in s_matnr and
werks in s_werks and
lgort in s_lgort.
endselect.
if sy-subrc <> 0.
message e899 with 'No Data found for the Selection Criteria'(006).
endif.
endform. "validate_screen
*& Form get_headings
Write the Report and Column Headings
form get_headings.
data: l_repid type sy-repid.
l_repid = sy-repid.
call function 'Y_STANDARD_HEADING'
exporting
repid = l_repid
heading1 = sy-title.
write:/1(125) sy-uline.
format color col_heading on.
write : /1 sy-vline, 2(18) 'Material Number'(008) centered,
20 sy-vline, 21(40) 'Material Description'(011) centered,
61 sy-vline, 62(22) 'Ratio'(009) centered,
84 sy-vline, 85(18) 'Quantity'(010) centered,
103 sy-vline, 104(20) 'Base Unit of Measure'(015) centered,
125 sy-vline.
write:/1(125) sy-uline.
format color off.
endform. "get_headings
*& Form get_mat_stock_data
Get the Material and Batch Stock data from MARA and MCHB Tables
form get_mat_stock_data.
clear: i_mchb,i_output, i_output1.
refresh: i_mchb,i_output, i_output1.
select a~matnr " Material Number
b~werks " Plant
b~lgort " Storage Location
b~charg " Batch Number
b~clabs " Stock Value
a~meins " Base Unit of Measure
into table i_mchb
from mara as a inner join mchb as b
on amatnr eq bmatnr
where b~matnr in s_matnr and
b~werks in s_werks and
b~lgort in s_lgort.
if sy-subrc <> 0.
g_exit = c_flag.
message s899 with 'No Data found for the Selection Criteria'(006).
stop.
endif.
sort i_mchb by matnr werks lgort charg.
endform. " get_mat_stock_data
*& Form get_plant_grp_data
Get the Material Group Text and Plant Name from T023T and T001W
form get_plant_grp_data.
if not i_mchb[] is initial.
Get the Plant Description from t001w Table
clear i_plant.
refresh i_plant.
select werks " Plant
name1 " Name
into table i_plant
from t001w
for all entries in i_mchb
where werks = i_mchb-werks.
Get the Material Description from MAKT Table
clear i_makt.
refresh i_makt.
select matnr " Material number
maktx " Material Description
into table i_makt
from makt
for all entries in i_mchb
where matnr = i_mchb-matnr and
spras = sy-langu.
sort i_plant by werks.
delete adjacent duplicates from i_plant comparing werks.
sort i_makt by matnr.
delete adjacent duplicates from i_makt comparing matnr.
endif.
endform. "form get_plant_grp_data.
*& Form append_final_data
Append the data into final Internal Table
form append_final_data.
data : l_matbatch(28),
l_tabix like sy-tabix.
if not i_mchb[] is initial.
loop at i_mchb.
l_tabix = sy-tabix.
clear l_matbatch.
concatenate i_mchb-matnr i_mchb-charg into l_matbatch.
move-corresponding i_mchb to i_output.
Get the Plant Description from i_plant Table
read table i_plant with key werks = i_mchb-werks binary search.
if sy-subrc = 0.
i_output-name1 = i_plant-name1.
endif.
Get the Material Description from i_makt Table
read table i_makt with key matnr = i_mchb-matnr binary search.
if sy-subrc = 0.
i_output-maktx = i_makt-maktx.
endif.
Get the Characteristic Values data from INOB and AUSP Tables
clear inob.
select single cuobj from inob
into inob-cuobj
where klart = c_klart and
obtab = c_obtab and
objek = l_matbatch.
if sy-subrc = 0.
select objek
atinn
atflv
from ausp
into table i_ausp
where objek = inob-cuobj and
atinn in s_atinn and
klart = c_klart.
sort i_ausp by objek atinn.
loop at i_ausp.
clear cabn.
select single atinn atnam from cabn
into (cabn-atinn,cabn-atnam)
where atinn = i_ausp-atinn.
if sy-subrc = 0.
If the ratio value is between 13-14.99, display 13
if cabn-atnam cs c_ratio.
if i_ausp-atflv between c_13 and c_1499.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_13.
If the ratio value is between 15-16.99, display 15
elseif i_ausp-atflv between c_15 and c_1699.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_15.
If the ratio value is between 17-18.99, display 17
elseif i_ausp-atflv between c_17 and c_1899.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_17.
If the ratio value is between 19-20.99, display 19
elseif i_ausp-atflv between c_19 and c_2099.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_19.
If the ratio value is between 21-22.99, display 21
elseif i_ausp-atflv between c_21 and c_2299.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_21.
If the ratio value is greater than or equal to 23, display 23
elseif i_ausp-atflv >= c_23.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_23.
endif. " Condition for RATIO values
else. " If characteristic does contain RATIO
i_mchb-atflv = i_ausp-atflv.
endif.
i_output-atinn = cabn-atinn.
i_output-atnam = cabn-atnam.
i_output-atflv = i_ausp-atflv.
i_mchb1-matnr = i_mchb-matnr.
i_mchb1-werks = i_mchb-werks.
i_mchb1-lgort = i_mchb-lgort.
i_mchb1-charg = i_mchb-charg.
i_mchb1-clabs = i_mchb-clabs.
i_mchb1-atinn = i_ausp-atinn.
i_mchb1-atflo = i_mchb-atflv.
i_mchb1-atflv = i_ausp-atflv.
append : i_output, i_mchb1.
clear i_mchb1.
modify i_mchb index l_tabix transporting atflo atflv .
endif.
endloop.
endif.
endloop.
endif.
Checking whether the table is filled or not
if not i_output[] is initial.
sort i_output by atinn werks matnr atflv.
else.
g_exit = c_flag.
message s899 with 'No Data found for the Selection Criteria'(006).
endif.
Delete the records where RATIO is less than 13.
delete i_output where atnam cs c_ratio and atflv lt c_13.
endform. "append_final_data
*& Form display_report
Display the Report Output data
form display_report.
data: l_tabix like sy-tabix.
loop at i_output1.
l_tabix = sy-tabix.
At new Characteristic
at new atinn.
read table i_output1 index l_tabix.
format color 1 intensified on.
write: /1 sy-vline, 2(20) 'Characteristic Name:'(007),
23(40) i_output1-atnam,
125 sy-vline.
format color off.
format color 4 intensified on.
write: /1 sy-vline, 2(20) 'Plant Name :'(022),
23(4) i_output1-werks, 29(30) i_output1-name1,
125 sy-vline.
format color off.
write /1(125) sy-uline.
endat.
clear: g_clabs, g_clabs1.
format color col_normal.
write :/1 sy-vline, 2(18) i_output1-matnr,
20 sy-vline, 21(40) i_output1-maktx,
61 sy-vline.
if i_output1-atflv = c_c23.
write: 62(22) c_g23 centered.
else.
shift i_output1-atflv left deleting leading space.
write: 62(22) i_output1-atflv centered.
endif.
write: 84 sy-vline,
103 sy-vline,
110(5) i_output1-meins.
If the quantity value is negative
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
hide : i_output1.
new-line.
At end of material
at end of matnr.
sum.
move : i_output1-matnr to g_matnr.
format color 3 intensified on.
write /1(125) sy-uline.
write :/1 sy-vline, 2(25) 'Total for Material :'(012),
28(18) g_matnr.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
write: 125 sy-vline.
format color off.
write /1(125) sy-uline.
endat.
At end of plant
at end of werks.
sum.
move : i_output1-werks to g_werks.
format color 3 intensified off.
write :/1 sy-vline, 2(25) 'Total for Plant :'(013),
28(4) g_werks.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
write /1(125) sy-uline.
endat.
At end of characteristic
at end of atinn.
read table i_output1 index l_tabix.
sum.
format color 3 intensified on.
write :/1 sy-vline, 2(25) 'Total for Characteristic:'(014),
28(25) i_output1-atnam.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
write /1(125) sy-uline.
endat.
endloop.
endform. " display_report
*& Form DISPLAY_BATCH
Display the batch details for the seclected material *
form display_batch.
Get the batch details for the selected material
get cursor field g_cursor.
if g_cursor = c_cursor1 or
g_cursor = c_cursor2 or
g_cursor = c_cursor3 or
g_cursor = c_cursor4 or
g_cursor = c_cursor5 or
g_cursor = c_cursor6.
format color 3.
write: /1 sy-vline,
2(17) 'Material Number :'(020),
20(17) i_output1-matnr,
94 sy-vline.
format color off.
write /1(94) sy-uline.
loop at i_mchb1 where matnr = i_output1-matnr and
atinn = i_output1-atinn and
atflo = i_output1-atflv.
format color col_normal.
shift i_mchb1-charg left deleting leading '0'.
write :/1 sy-vline, 2(16) i_mchb1-lgort centered,
18 sy-vline, 19(17) i_mchb1-charg centered,
36 sy-vline.
if i_output1-atnam cs c_ratio.
write: 37(29) i_mchb1-atflv
exponent 0 decimals 2 centered.
else.
write : 37(29) i_mchb1-atflv
exponent 0 decimals 0 centered.
endif.
write : 66 sy-vline, 67(27) i_mchb1-clabs unit i_mchb-meins,
94 sy-vline.
format color off.
endloop.
write /1(94) sy-uline.
else.
message s899 with 'Invalid cursor position'(016).
exit.
endif.
endform. " DISPLAY_BATCH
*& Form HEADING_SECLIST
Write the Column Headings for Interactive Report
form heading_seclist.
write /1(94) sy-uline.
format color col_heading on.
write :/1 sy-vline, 2(16) 'Storage Location'(021),
18 sy-vline, 19(17) 'Batch Number'(017) centered,
36 sy-vline, 37(29) 'Characteristic Value'(018) centered,
66 sy-vline, 67(27) 'Quantity'(019) centered,
94 sy-vline.
write /1(94) sy-uline.
format color off.
endform. " HEADING_SECLIST
*& Form COLLECT_RATIO
Display the Characteristic ratio data
form collect_ratio.
loop at i_output.
clear g_atinn.
i_output1-atinn = i_output-atinn.
i_output1-atnam = i_output-atnam .
i_output1-werks = i_output-werks.
i_output1-name1 = i_output-name1.
i_output1-matnr = i_output-matnr.
i_output1-maktx = i_output-maktx.
i_output1-clabs = i_output-clabs.
i_output1-meins = i_output-meins.
call function 'CONVERSION_EXIT_ATINN_OUTPUT'
exporting
input = i_output-atinn
importing
output = g_atinn.
if g_atinn cs c_ratio.
If the ratio value is between 13-14.99, display 13
if i_output-atflv between c_13 and c_1499.
i_output1-atflv = c_13.
If the ratio value is between 15-16.99, display 15
elseif i_output-atflv between c_15 and c_1699.
i_output1-atflv = c_15.
If the ratio value is between 17-18.99, display 17
elseif i_output-atflv between c_17 and c_1899.
i_output1-atflv = c_17.
If the ratio value is between 19-20.99, display 19
elseif i_output-atflv between c_19 and c_2099.
i_output1-atflv = c_19.
If the ratio value is between 21-22.99, display 21
elseif i_output-atflv between c_21 and c_2299.
i_output1-atflv = c_21.
If the ratio value is greater than or equal to 23, display 23
elseif i_output-atflv >= c_23.
i_output1-atflv = c_23.
endif.
write i_output1-atflv to i_output1-atflv .
else.
write i_output-atflv to i_output1-atflv exponent 0 decimals 0.
endif.
collect i_output1.
clear i_output1.
endloop.
sort i_output1 by atinn werks matnr atflv.
endform. " COLLECT_RATIO
Reward if useful..
Regards,
Anji
Maybe you are looking for
-
Questions regarding how I pay my Line Rental Bill ...
Hi BT, I'm currently a BE Broadband customer, I was a BT Broadband customer back in the days when you had BT Home Hub 1.0 and 8mb packages which i was only getting like 5-6mb, 0.3mb upload and constant speed caps on my connection to 1mb. You guys
-
Can you open an iCloud account without creating a new or using an old AppleID?
Got a new iPhone and had to skip the part of establishing an icloud account till later, cause I was having internet trouble, so it asked me to continue and go back later, then I saw that as I went into icloud in settings later that it is asking for m
-
Compressor ProRes 422 (L/T) to FCP
Howdy! I'm taking .mov H.264 files and throwing them into compressor, and on the other end receiving ProRes 422 (L/T) files just perfectly. When I put the ProRes footage into a FCP timeline, I still have to render the audio!! Why is this? I actually
-
Nokia 5800 - the selected files could not be copie...
I'm trying to move a few files around on my memory card whilst the phone is plugged into my pc. There is over a gb of free space on the memory card. I get the following error the selected files could not be copied there is not enough free space on t
-
Format of the parallel port base address
Just wondering if someone could please help with what I'm sure is a simple question I'm currently trying the control the first 3 bits of the parallel port using the Out Port sub vi. Using the Labview examples and help I can see how to find the base a