Validating input if nonalphanumeric character without using regex
Hi Guys,
I am trying to validate if the user input does not contain any alphanumeric characters such as (A-Z, a-z, 0-9)... The problem was solved through this forum by using regex....
Unfortunately I'm developing with Blackberry (RIM IDE) but it seems that it doesn't support java.util.regex.Pattern and java.util.regex.Matcher;
Is there any other solutions to this problem? Can java.util.regex.* be added to Blackberry JDE?
If anybody knows any solution to this problem...Please let me know...
Please help... Thanks in advance
public boolean method(String s) {
loop over String {
if (current char is not a valid char) {
return false;
return true;
}
Similar Messages
-
Email address validation, is there a way to use Regex or other fuzzy searching?
I would like to use PL/SQL for Email address validation, is there a way to use Regex (regular expressions) or some other fuzzy searching for that? Using % and _ wildcards only take you so far...
I need something that will verify alphanumeric charectors (no ",'.:#@&*^ etc.) any ideas?
Current code:
if email not like '_%@_%.__%' or email like '%@%@%' or email like '% %' or email like '%"%' or email like '%''%' or email like '%
%' then
The last line is to make sure there are no linebreaks in the middle of the email address, is there a better way to signify a line break, like \n or an ascii equivilent?Michael:
The as noted in the previous post, DBI is a Perl package that allows Perl to talk to various databases, including Oracle. We use DBI on several UNIX servers, and it does not require ODBC, and I have always found it to be extremely quick. Things may be different in the Windows world.
If you are spooling files out to run through Perl anyway, you may want to take a look at DBI. You could probably modify your existing scripts to use DBI fairly easily. The basic structure using DBI is like:
use DBI;
my dbh; # A database handle
my sth; # A statment handle
my sqlstr; # SQL statement
my db_vars; # Variables for your db columns
# Connect to the database
$dbh = DBI->connect( "dbi:Oracle:service_name","user/password");
$sqlstr = 'SELECT * FROM emp WHERE id = ?' # even takes bind variables
#Prepare statement
$sth = $dbh->prepare($sqlstr);
$sth->execute(12345); # Execute with values for bind if desired
# Walk the "cursor"
while (($db_vars) = $sth->fetchrow_array()) {
your processing here -
Validating Input Email Address via regex
Hi Experts,
We have a requirement to validate Input email address for External Partners to be an email address from non-client domain.
Planning to validate the same using regex in 'Validation' tab of custom attribute 'Z_TEMP_EMAIL_EXT', mapped to the UI task used for External User ID creation.
Client has two email domains, namely '[email protected]' and '[email protected]'
I have arrived at below regex for validating the client domain; and attempts to ensure these are NOT input (negative condition) are not working.
Please suggest how to validate regex for NOT including these domains.
(1) "^(.*)[\@](clientabc|xyzclient)[\.](com)"
(2) "^(.*)[\@](clientabc|xyzclient)[\.](.*)"
(3) "(\Qclientabc\E)|(\Qxyzclient\E)"
With Regards,
Ganesh.SHello Ganesh,
you want negative lookahead with alternation, like this:
.+@(?!clientabc\.com$|xyzclient\.com$).+
Please note, though, that the above regex does not provide any POSITIVE guarantee that the input is a valid SMTP address as specified by RFC2821.
It just provides a negative guarantee that the input is NOT an SMTP address from domains clientabc.com or xyzclient.com.
Best regards,
Lambert -
I have a macmini on order, I wonder if I can pair the wireless apple keyboard and magic touchpad without using any other input devices, especially, since everything is brand new and not yet paired.
You may just want to save yourself any possible issues
by just hooking up a wired keyboard and mouse on first
start up. Any USB keyboard and mouse should work.
There have been many that have had problems on first boot
using the Bluetooth devices. -
Form validation without using dreamweaver
Is there a way to validate an email textfield in a form without using javascript. I would continue using javascript for the validation except people are getting around the validation by disabling the javascript validation that dreamweaver cs4 supplies.
You can validate your HTML at this link:
<http://validator.w3.org/>
And your CSS at this link:
<http://jigsaw.w3.org/css-validator/>
Does this answer your question?
G/L -
Button action bypass validation without using Immediate=true
I have a Form in a page, and a "Query" button to popup a dialog for user to search some information, and help user to fill-in some fields.
I want the "Query" button to ignoral all the validations in the Form (e.g.: required fields). I tried to set the Immedate for the button, but I found I cannot set any inputText value inside ReturnListener event-handler with Immedate is true.
Is there anyway to have a button to action, and bypass all the validation without using Immediate=true?
Thanks,
Samson FuHi,
if you are on JDeveloper 11g, have a look at the skipValidation property on the ADF binding and read: http://oracle.com/technology/products/jdev/tips/fnimphius/ppr_subform/index.html
You can implement a similar approach
Frank -
Is it possible for a mac to recognise a camcorder as a video input without using imovie/final cut, I use web based video capture software and need an HD input that the mac would recognise as if it were a webcam?
Any help would be greatly appreciated!
ThanksHI,
I used to use an analogue Camcorder and a DV converter that had Firewire output at one stage when starting out in iChat.
See the Item 3 in the "Before your Start" item on this page
8:41 PM Saturday; November 12, 2011
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb( 10.6.8)
Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images." No, Seriously
Message was edited by: Ralph Johns (UK) -
Exchange 2013 Mail flow rule using RegEx
We're trying to implement a rule on certain mailboxes that it shouldn't accept an email without a subject.
I found documentation from Microsoft on exchange 2010 to Configure
a Transport Rule for Messages That Have a Blank Subject, but I tried using the ^$ RegEx
with Exchange 2013 and it doesn't seem to work.
I also looked at the Transport
Rule Predicates for Exchange 2013 and it clearly says thatSubjectMatchesPatterns
matches messages where text patterns in the Subject field match a specified regular expression.
My workaround was to reject all messages to those specific mailboxes except if subject pattern matches. but
if I want to add now conditions ie. to reject emails with a subject "Sent from my snipping tool" I can't do it.
I found Here that
Exchange 2013 now supports extended RegEx but I didn't find that the syntax for ^$should
be any different in extended RegEx.If you use any special character in the RegEx you must use
\m Escape m, where m is one of the meta characters described above: ^, ., $, |, (), [], *, +, ?, \, or /.
as decribed in http://technet.microsoft.com/en-us/library/jj674702%28v=exchg.150%29.aspx -
The scenario is:-
Web Service Client -->input-->BPEL-->if input valid-->trigger file adapter with read operation--> receive file
i am not able to stop the polling until it is required to trigger the polling.
As soon as i deploy the composite the file adapter starts polling without waiting for input.
Since i am using two receive activities, the second one which is suppose to receive file from file adapter is always showing pending state. (asynchronous callback)Hi there,
IMHO the traditional read is used only as inbound operation, that means
that it starts polling the input folder as soon as the composite gets
deployed - which is the same you are experiencing.
In your case you need an outbound operation that needs to be invoked at
a certain moment. I don't know what are the reasons not to use sync
read, but this is the only outbound read operation supported by the
adapter. If you can not use the sync read, then you would have to design
some custom solution where you call a web service or EJB for instance
that reads the desired files.
Another option I can think of, though have not use personally is using
the adapters programatically in Java - take a look at this blog post as
it seems related to this topic -
https://technology.amis.nl/2012/01/22/using-the-oracle-weblogic-technology-adapters-with-custom-java-message-driven-bean-mdb-triggered-by-file-adapter-part-of-the-story/.
Hope this helps,
A. -
How to save the session states for a tabular form WITHOUT using check boxs?
Greeting guys,
As you know that we can use collections to save the session states of a tabular forms, described in the how-to doc of manual tabular forms. However, what I am trying to do ( or have to do) is to provide a manual tabular form, and save the session states for validation, without using the check boxes. Because a user can put contents into some columns in a row without checking the corresponding checkbox, according to the requirements. So basically what I tried is to loop over all the rows and save Every entry into a collection. However, sometimes I got "no data found" error with unknown reasons.
My current solution is to use the "dirty" Retry button that gets back the history, which IMO is not a good workabout. So, I'd appreciate if somebody can shed some light on a better solution, especially if it is close to the one in that how-to doc.
Thanks in advance.
LucThe following is the first collection solutin I've tried:
htmldb_collection.create_or_truncate_collection('TEMP_TABLE');
for i in 1..p_row_num loop -- Loop on the whole form rows
if (htmldb_application.g_f01(i) is not null) or (htmldb_application.g_f05(i) <> 0)
--If either of them has some input values, the row should be saved into the colleciton.
then
htmldb_collection.add_member(
p_collection_name => 'TEMP_TABLE',
p_c001 => htmldb_application.g_f01(i),
p_c002 => htmldb_application.g_f03(i),
p_c003 => htmldb_application.g_f04(i),
p_c004 => htmldb_application.g_f05(i),
p_c005 => htmldb_application.g_f06(i),
p_c006 => htmldb_application.g_f08(i)
end if;
end loop;
Some of columns have null values, but I don't think that's the reason. Because once I clicked all the check boxes, there would be no error no matter what values were in other columns.
Another issue would be extract the values FROM the collection, which has been tried because I had problem to store the data into the collection. I used "decode" functions inside the SQL to build the tabular form. I am not sure whether it will be the same as a regular SQL for a tabular form, like the example in the How-to doc.
Also I didn't use the checksum, for it is not an issue at the current stage. I am not sure whether that's the reason which caused the NO DATA FOUND error. -
Send multiple records to rfc without using BPM
Dear Experts,
Could you please help on the following scenario.
I need to send multiple customer master data records from a file to rfc without using BPM.
The following is the mapping i am using
source Target( RFC)
====== =============
Tree occurance type Tree occurance
cust_mt 1..1
customer 0..unbound -
> ztest_cust( rfc ) 1..1
cname 1..1 -
> cname 0..1
cno 1..1 -
> cno 0..1
bank -
> bank 0..1
item : 0..unbound
code -
> code 0..1
name -
> name 0..1
location -
> location 0..1
1. Multiple banks possible for one customer
2. Multiple customers possible in datafile from mdm
Problem 1:Only one customer record from file is being sent to RFC thouth many records are in the file, the second, third .. and so on records not being sent to rfc.
Problem 2:
if add o.. unbound for the rfc occurance, <messages>,<message1> tags are getting added in message mapping, and no single customer record sent to rfc..
Your help is rewarded with good points.
Appreciate your help.
Thanks.
sravya.Hi VJ,
Thank you for the immediate reply.
one more thing, when i tried to change the occurences of ztest_cust( rfc) to 0..unbound,
I am not seeing the occurances updated in the imported rfc structure.
The following is the wsdl for rfc, could you please help me to add occurances 0..unbound.
Thanks a lot.
sraya.
<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" name="ZTEST_CUST" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<wsdl:documentation>
test for mdm
</wsdl:documentation>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="ZTEST_CUST">
<xsd:complexType>
<xsd:all>
<xsd:element name="CNAME" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CNO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BANK" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZST_CUST" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZTEST_CUST.Response">
<xsd:complexType>
<xsd:all>
<xsd:element name="BANK" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZST_CUST" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ZST_CUST">
<xsd:sequence>
<xsd:element name="CODE" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NAME" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LOCATION" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ZTEST_CUST.Input">
<wsdl:part name="parameters" element="rfc:ZTEST_CUST" />
</wsdl:message>
<wsdl:message name="ZTEST_CUST.Output">
<wsdl:part name="parameters" element="rfc:ZTEST_CUST.Response" />
</wsdl:message>
<wsdl:portType name="ZTEST_CUST.PortType">
<wsdl:operation name="ZTEST_CUST">
<wsdl:input message="rfc:ZTEST_CUST.Input" />
<wsdl:output message="rfc:ZTEST_CUST.Output" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ZTEST_CUST.SAPBinding" type="rfc:ZTEST_CUST.PortType">
<rfc:binding style="rfc" />
<rfc:type name="ZST_CUST">
<ifr:container xmlns:ifr="urn:sap-com:ifr:v2:metamodel" xmlns:xlink="http://www.w3.org/1999/xlink">
<ifr:descriptor>
<ifr:description language="EN">
test
</ifr:description>
</ifr:descriptor>
<ifr:properties>
<ifr:sourceSystem />
<ifr:sourceClient>
020
</ifr:sourceClient>
<ifr:release>
640
</ifr:release>
<ifr:category>
structure
</ifr:category>
<ifr:unicode1>
true
</ifr:unicode1>
<ifr:unicode2>
true
</ifr:unicode2>
<ifr:isFlatStructure>
true
</ifr:isFlatStructure>
</ifr:properties>
<ifr:definition>
<ifr:internalLength1>
180
</ifr:internalLength1>
<ifr:internalLength2>
360
</ifr:internalLength2>
<ifr:fields>
<ifr:field name="CODE" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
0
</ifr:offset1>
<ifr:offset2>
0
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
<ifr:field name="NAME" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
60
</ifr:offset1>
<ifr:offset2>
120
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
<ifr:field name="LOCATION" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
120
</ifr:offset1>
<ifr:offset2>
240
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
</ifr:fields>
</ifr:definition>
</ifr:container>
</rfc:type>
<wsdl:operation name="ZTEST_CUST">
<ifr:container xmlns:ifr="urn:sap-com:ifr:v2:metamodel" xmlns:xlink="http://www.w3.org/1999/xlink">
<ifr:descriptor>
<ifr:description language="EN">
test for mdm
</ifr:description>
</ifr:descriptor>
<ifr:properties>
<ifr:sourceSystem />
<ifr:sourceClient>
020
</ifr:sourceClient>
<ifr:release>
640
</ifr:release>
<ifr:package>
$TMP
</ifr:package>
<ifr:akhNode />
<ifr:released>
external
</ifr:released>
<ifr:outbound>
false
</ifr:outbound>
<ifr:synchronous>
true
</ifr:synchronous>
<ifr:asynchronous>
false
</ifr:asynchronous>
<ifr:unicode1>
true
</ifr:unicode1>
<ifr:unicode2>
true
</ifr:unicode2>
</ifr:properties>
<ifr:definition>
<ifr:parameters>
<ifr:parameter name="CNAME">
<ifr:descriptor>
<ifr:description language="EN">
Character Field Length = 10
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:scalarType name="CHAR10">
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:fixedValuesListDefined>
false
</ifr:fixedValuesListDefined>
<ifr:mixedCaseSupported>
false
</ifr:mixedCaseSupported>
<ifr:signedNumber>
false
</ifr:signedNumber>
</ifr:properties>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
10
</ifr:length>
<ifr:internalLength1>
10
</ifr:internalLength1>
<ifr:internalLength2>
20
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
<ifr:outputLength>
10
</ifr:outputLength>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
<ifr:properties>
<ifr:direction>
in
</ifr:direction>
<ifr:class>
import
</ifr:class>
<ifr:type>
scalar
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
<ifr:parameter name="CNO">
<ifr:descriptor>
<ifr:description language="EN">
Character Field Length = 10
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:scalarType name="CHAR10">
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:fixedValuesListDefined>
false
</ifr:fixedValuesListDefined>
<ifr:mixedCaseSupported>
false
</ifr:mixedCaseSupported>
<ifr:signedNumber>
false
</ifr:signedNumber>
</ifr:properties>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
10
</ifr:length>
<ifr:internalLength1>
10
</ifr:internalLength1>
<ifr:internalLength2>
20
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
<ifr:outputLength>
10
</ifr:outputLength>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
<ifr:properties>
<ifr:direction>
in
</ifr:direction>
<ifr:class>
import
</ifr:class>
<ifr:type>
scalar
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
<ifr:parameter name="BANK">
<ifr:descriptor>
<ifr:description language="EN">
test bank type
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:complexType xmlns:xlink="http://www.w3.org/1999/xlink" name="ZST_CUST" type="structure" xlink:role="type" xlink:href="/Content?TYPE=type&NAME=ZST_CUST" />
</ifr:definition>
<ifr:properties>
<ifr:direction>
inout
</ifr:direction>
<ifr:class>
tables
</ifr:class>
<ifr:type>
structure
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
</ifr:parameters>
</ifr:definition>
</ifr:container>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions> -
Authorization check without using variable of type u0093Authorizationu0094
In WEB-reporting we want to authorize on a navigational attribute without using the variable of type
Authorization. Why would we do this?
1. In a lot of queries we have to replace the existing variable of type User entry to a variable of type Authorization. We would like to avoid this work.
2. When the variable is not ready for input the Report will always include all the characteristic values for which the user is authorized. We dons want this.
3. When the variable is ready for input on the selection screen all the authorized values are displayed and the user is able to select / deselect the values he/she wants to report. In case of a lot of authorized characteristic values the screen does not appear user-friendly.
What we want is a behavior like some parts of R/3. For example: Controlling Area X consists of the Costcenters C1000, C2000, C3000, C4000, C5000 and C6000. A particular user has authorization for Cost centers C1000, C3000 and C5000. When running a ABAP-report with Cosctcenters the user is able to select certain Costcenters. Three possibilities:
1. The user selects Costcenter C1000, C3000 and / or C5000: the ABAP reports the selected Costcenters.
2. The user selects Costcenter C2000, C4000 and / or C6000: the ABAP gives an error-message: no authorization.
3. The user does not select any Costcenters: the ABAP reads all the Costcenters and reports on the basis of the users authorization only Costcenters C1000, C3000 and C5000.
In term of BW: we would like to introduce authorizations for a specific InfoObject which is used as an navigational of an other InfoObject. In the queries a variable is used of the type User entry. The user can select one or more values on the selection screen; an authorization check is fulfilled. He may however choose to leave the selection field empty; in this case the OLAP processor should report only the authorized values (in our case the last situation results directly in an error-message no authorization).
Anyone has a suggestion?
Thx in advance,
HenkIf you change the variable to type exit, and user input enabled, you can then build your logic in the user exit.
If users have entered unauthorised values, it will be checked (by the system??). If this assumption is correct then all you need to do in your exit is to continue with the values entered by the user; and in case user has entered no values, populate the variable with values valid for the user (by reading the user authorization and corresponding charactertistics values and moving these to the variable).
--> Adding further
Since the authorization will not be checked by the system (I missed that these are not of authorization type variables), user exit will need to do this check. The logic for doing authorization checks / error messages / restricting based on authorizations - will have to be done in the user-exit.
cheers,
Message was edited by: Ajay Das -
ALV Tree Report without using ABAP Objects
Hi all,
I want to know the name of a function module to create ALV Tree in SE38 as a report. I am required to create this ALV Tree Report without using ABAP OBJECTS. Can u pls help me as early as possible.Hi
see this link
http://www.sapdev.co.uk/reporting/alv/alvtree.htm
*& Report ZBCALV_TREE
REPORT ZBCALV_TREE.
class cl_gui_column_tree definition load.
class cl_gui_cfw definition load.
data tree1 type ref to cl_gui_alv_tree.
data mr_toolbar type ref to cl_gui_toolbar.
include <icon>.
include bcalv_toolbar_event_receiver.
include bcalv_tree_event_receiver.
data: toolbar_event_receiver type ref to lcl_toolbar_event_receiver.
data: gt_VBAK type VBAK occurs 0, "Output-Table
gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog
ok_code like sy-ucomm. "OK-Code
start-of-selection.
end-of-selection.
call screen 100.
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'MAIN'.
if tree1 is initial.
perform Zinit_tree.
endif.
call method cl_gui_cfw=>flush.
endmodule. " STATUS_0100 OUTPUT
*& Form Zinit_tree
text
--> p1 text
<-- p2 text
form Zinit_tree .
perform Zbuild_fieldcatalog.
create container for alv-tree
data: l_tree_container_name(30) type c,
l_custom_container type ref to cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
if sy-batch is initial.
create object l_custom_container
exporting
container_name = l_tree_container_name
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
endif.
create tree control
create object tree1
exporting
parent = l_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
create Hierarchy-header
data l_hierarchy_header type treev_hhdr.
perform zbuild_hierarchy_header changing l_hierarchy_header.
create info-table for html-header
data: lt_list_commentary type slis_t_listheader,
l_logo type sdydo_value.
perform Zbuild_comment using
lt_list_commentary
l_logo.
repid for saving variants
data: ls_variant type disvariant.
ls_variant-report = sy-repid.
create emty tree-control
call method tree1->set_table_for_first_display
exporting
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary
i_logo = l_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
changing
it_outtab = gt_VBAK "table must be emty !!
it_fieldcatalog = gt_fieldcatalog.
create hierarchy
perform Zcreate_hierarchy.
add own functioncodes to the toolbar
perform zchange_toolbar.
register events
perform zregister_events.
endform. " Zinit_tree
*& Form Zbuild_fieldcatalog
text
--> p1 text
<-- p2 text
form Zbuild_fieldcatalog .
get fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'VBAK'
changing
ct_fieldcat = gt_fieldcatalog.
sort gt_fieldcatalog by scrtext_l.
change fieldcatalog
data: ls_fieldcatalog type lvc_s_fcat.
loop at gt_fieldcatalog into ls_fieldcatalog.
case ls_fieldcatalog-fieldname.
when 'AUART' .
ls_fieldcatalog-no_out = 'X'.
ls_fieldcatalog-key = ''.
endcase.
modify gt_fieldcatalog from ls_fieldcatalog.
endloop.
endform. " Zbuild_fieldcatalog
*& Form zbuild_hierarchy_header
text
<--P_L_HIERARCHY_HEADER text
form zbuild_hierarchy_header changing
p_hierarchy_header type treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy Header'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'This is the Hierarchy Header !'. "#EC NOTEXT
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
endform. " zbuild_hierarchy_header
*& Form Zbuild_comment
text
-->P_LT_LIST_COMMENTARY text
-->P_L_LOGO text
form Zbuild_comment using
pt_list_commentary type slis_t_listheader
p_logo type sdydo_value.
data: ls_line type slis_listheader.
LIST HEADING LINE: TYPE H
clear ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'ALV-tree-demo: flight-overview'. "#EC NOTEXT
append ls_line to pt_list_commentary.
STATUS LINE: TYPE S
clear ls_line.
ls_line-typ = 'S'.
ls_line-key = 'valid until'. "#EC NOTEXT
ls_line-info = 'January 29 1999'. "#EC NOTEXT
append ls_line to pt_list_commentary.
ls_line-key = 'time'.
ls_line-info = '2.00 pm'. "#EC NOTEXT
append ls_line to pt_list_commentary.
ACTION LINE: TYPE A
clear ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'actual data'. "#EC NOTEXT
append ls_line to pt_list_commentary.
p_logo = 'ENJOYSAP_LOGO'.
endform. " Zbuild_comment
*& Form Zcreate_hierarchy
text
--> p1 text
<-- p2 text
form Zcreate_hierarchy .
data: ls_vbak type vbak,
lt_vbak type vbak occurs 0.
get data
select * from vbak into table lt_vbak
up to 200 rows . "#EC CI_NOWHERE
sort lt_vbak by AUART.
add data to tree
data: l_AUART_key type lvc_nkey.
loop at lt_vbak into ls_vbak.
on change of ls_vbak-AUART.
perform Zadd_AUART_line using ls_vbak
changing l_AUART_key.
endon.
endloop.
calculate totals
call method tree1->update_calculations.
this method must be called to send the data to the frontend
call method tree1->frontend_update.
endform. " Zcreate_hierarchy
*& Form Zadd_AUART_line
text
-->P_LS_vbak text
-->P_0379 text
<--P_L_AUART_KEY text
form Zadd_AUART_line using p_ls_vbak type vbak
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value,
ls_vbak type vbak.
set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-style =
cl_gui_column_tree=>style_intensifd_critical.
append ls_item_layout to lt_item_layout.
add node
l_node_text = p_ls_vbak-AUART.
data: ls_node type lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_vbak
is_node_layout = ls_node
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key .
endform. " Zadd_AUART_line
*& Form zchange_toolbar
text
--> p1 text
<-- p2 text
form zchange_toolbar .
get toolbar control
call method tree1->get_toolbar_object
importing
er_toolbar = mr_toolbar.
check not mr_toolbar is initial.
add seperator to toolbar
call method mr_toolbar->add_button
exporting
fcode = ''
icon = ''
butn_type = cntb_btype_sep
text = ''
quickinfo = 'This is a Seperator'. "#EC NOTEXT
add Standard Button to toolbar (for Delete Subtree)
call method mr_toolbar->add_button
exporting
fcode = 'DELETE'
icon = '@18@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'Delete subtree'. "#EC NOTEXT
add Dropdown Button to toolbar (for Insert Line)
call method mr_toolbar->add_button
exporting
fcode = 'INSERT_LC'
icon = '@17@'
butn_type = cntb_btype_dropdown
text = ''
quickinfo = 'Insert Line'. "#EC NOTEXT
set event-handler for toolbar-control
create object toolbar_event_receiver.
set handler toolbar_event_receiver->on_function_selected
for mr_toolbar.
set handler toolbar_event_receiver->on_toolbar_dropdown
for mr_toolbar.
endform. " zchange_toolbar
*& Form zregister_events
text
--> p1 text
<-- p2 text
form zregister_events .
define the events which will be passed to the backend
data: lt_events type cntl_simple_events,
l_event type cntl_simple_event.
define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_click.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
append l_event to lt_events.
call method tree1->set_registered_events
exporting
events = lt_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
set Handler
data: l_event_receiver type ref to lcl_tree_event_receiver.
create object l_event_receiver.
set handler l_event_receiver->handle_node_ctmenu_request
for tree1.
set handler l_event_receiver->handle_node_ctmenu_selected
for tree1.
set handler l_event_receiver->handle_item_ctmenu_request
for tree1.
set handler l_event_receiver->handle_item_ctmenu_selected
for tree1.
endform. " zregister_events
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
ok_code = sy-ucomm.
clear sy-ucomm.
case ok_code.
when 'EXIT' or 'BACK' or 'CANC'.
perform Zexit_program.
when others.
call method cl_gui_cfw=>dispatch.
endcase.
clear ok_code.
call method cl_gui_cfw=>flush.
endmodule. " USER_COMMAND_0100 INPUT
*& Form Zexit_program
text
--> p1 text
<-- p2 text
form Zexit_program .
call method tree1->free.
leave program.
endform. " Zexit_program
<b>Reward if usefull</b> -
Traffic Signals in ALV Without using oops only for normal Grid Display.
Hi Experts ,
I need to add traffic signals into my normal ALV Grid program without using oops concepts.
Please any one send me full code or provide me one program code without using oops concept for normal ALV Grid .
I searched in many forums but i found most of the programs wriiten using oops concept with ALV's but here my requirement without using oops concept and only normal reuse_alv_grid_display.
Thanks in Advance.
Venky.You can check the below sample code.Traffic light is implemented in it.
REPORT ztest NO STANDARD PAGE HEADING
LINE-SIZE 255 MESSAGE-ID zlqm.
TYPE-POOLS : slis,icon.
TABLES :qals,qave.
INCLUDE : zlqmr002_top, "Global Data Declaration
zlqmr002_selection_screen, "Selection Screen Inputs
zlqmr002_subroutine. "Subroutines
INITIALIZATION
INITIALIZATION.
PERFORM variant_init.
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
Check for Variant existance
PERFORM pai_of_selection_screen.
*Validation for Material
AT SELECTION-SCREEN ON s_matnr.
IF NOT s_matnr IS INITIAL.
SELECT SINGLE matnr
INTO g_matnr
FROM mara
WHERE matnr IN s_matnr.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_MATNR'.
MESSAGE e000 WITH text-003.
ENDIF.
ENDIF.
*Validation for Plant
AT SELECTION-SCREEN ON s_werk.
IF NOT s_werk IS INITIAL.
SELECT SINGLE werks
INTO g_werk
FROM t001w
WHERE werks IN s_werk.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_WERK'.
MESSAGE e000 WITH text-004.
ENDIF.
ENDIF.
*Validation for Inspection Type
AT SELECTION-SCREEN ON s_art.
IF NOT s_art IS INITIAL.
SELECT SINGLE art
INTO g_art
FROM tq30
WHERE art IN s_art.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_ART'.
MESSAGE e000 WITH text-005.
ENDIF.
ENDIF.
*Validation for Code group
AT SELECTION-SCREEN ON s_vcdgrp.
IF NOT s_vcdgrp IS INITIAL.
SELECT SINGLE codegruppe
INTO g_vcdgrp
FROM qpgr
WHERE codegruppe IN s_vcdgrp.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_VCDGRP'.
MESSAGE e000 WITH text-006.
ENDIF.
ENDIF.
*Validation for Code
AT SELECTION-SCREEN ON s_vcode.
IF NOT s_vcode IS INITIAL.
SELECT SINGLE code
INTO g_vcode
FROM qpcd
WHERE code IN s_vcode.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_VCODE'.
MESSAGE e000 WITH text-007.
ENDIF.
ENDIF.
Process on value request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcdgrp-low.
PERFORM get_codegroup.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcdgrp-high.
PERFORM get_codegroup.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcode-low.
PERFORM get_code.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vcode-high.
PERFORM get_code.
START-OF-SELECTION.
START-OF-SELECTION.
**Selecting data form Database tables
PERFORM select_data TABLES i_out i_out1.
END-OF-SELECTION
END-OF-SELECTION.
**Generate ALV
PERFORM generate_alv.
DATA TYPES
TYPES : BEGIN OF t_qals,
matnr TYPE qals-matnr, "Material
werk TYPE qals-werk, "Plant
mengeneinh TYPE qals-mengeneinh, "UOM
lmenge01 TYPE qals-lmenge01, "Unrestricted qty
lmenge02 TYPE qals-lmenge02, "Scrap qty
lmenge03 TYPE qals-lmenge03, "Sample qty
lmenge04 TYPE qals-lmenge04, "Blocked qty
lmenge05 TYPE qals-lmenge05, "Retain qty
lmenge06 TYPE qals-lmenge06, "Othermat qty
lmenge07 TYPE qals-lmenge07, "RTV qty
lmenge08 TYPE qals-lmenge08, "Exp.scrap qty
prueflos TYPE qals-prueflos, "Inspection lot
art TYPE qals-art, "Inspection type
charg TYPE qals-charg, "Batch
vcode TYPE qave-vcode, "Usage decision
vdatum TYPE qave-vdatum, "Date
qmnum TYPE qmel-qmnum, "Notification
END OF t_qals.
TYPES : BEGIN OF t_out,
icon TYPE icon-id, "Status
matnr TYPE qals-matnr, "Material
werk TYPE qals-werk, "Plant
mengeneinh TYPE qals-mengeneinh, "UOM
vcode TYPE qave-vcode, "Usage decision
mncod(30) TYPE c, "Disposition
lmenge01 TYPE qals-lmenge01, "Unrestricted qty
lmenge02 TYPE qals-lmenge02, "Scrap qty
lmenge03 TYPE qals-lmenge03, "Sample qty
lmenge04 TYPE qals-lmenge04, "Blocked qty
lmenge05 TYPE qals-lmenge05, "Retain qty
lmenge06 TYPE qals-lmenge06, "Othermat qty
lmenge07 TYPE qals-lmenge07, "RTV qty
lmenge08 TYPE qals-lmenge08, "Exp.scrap qty
prueflos TYPE qals-prueflos, "Inspection lot
art TYPE qals-art, "Inspection type
qmnum TYPE qmel-qmnum, "Notification
vdatum TYPE qave-vdatum, "Date
charg TYPE qals-charg, "Batch
END OF t_out.
TYPES : BEGIN OF t_qmsm,
qmnum TYPE qmsm-qmnum,
manum TYPE qmsm-manum,
mncod TYPE qmsm-mncod,
END OF t_qmsm.
TYPES: BEGIN OF t_disp,
qmnum TYPE qmsm-qmnum,
mncod(30) TYPE c,
END OF t_disp.
TYPES: BEGIN OF t_codegrp,
katalogart TYPE qpgt-katalogart,
codegruppe TYPE qpgt-codegruppe,
kurztext TYPE qpgt-kurztext,
END OF t_codegrp.
TYPES: BEGIN OF t_code,
katalogart TYPE qpct-katalogart,
codegruppe TYPE qpct-codegruppe,
code TYPE qpct-code,
version TYPE qpct-version,
kurztext TYPE qpct-kurztext,
END OF t_code.
INTERNAL TABLES
DATA: i_qals TYPE TABLE OF t_qals,
wa_qals LIKE LINE OF i_qals,
i_qmsm TYPE TABLE OF t_qmsm,
wa_qmsm TYPE t_qmsm,
i_disp TYPE TABLE OF t_disp,
wa_disp LIKE LINE OF i_disp,
i_out TYPE TABLE OF t_out,
wa_out TYPE t_out,
i_out1 TYPE TABLE OF t_out,
wa_out1 TYPE t_out,
i_codegrp TYPE TABLE OF t_codegrp,
i_code TYPE TABLE OF t_code,
i_qmsm_tmp TYPE TABLE OF t_qmsm.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_layout TYPE slis_layout_alv,
g_repid TYPE sy-repid,
wa_fieldcat TYPE slis_fieldcat_alv.
Global Variables
DATA : g_matnr TYPE matnr,
g_werk TYPE werks,
g_art TYPE qpart,
g_vcdgrp TYPE qvgruppe,
g_vcode TYPE qvcode,
g_red TYPE c,
g_yellow TYPE c,
g_table(6) TYPE c,
g_save(1) TYPE c,
g_exit(1) TYPE c,
g_report TYPE sy-repid,
g_var TYPE disvariant,
g_variant TYPE disvariant.
Constants
CONSTANTS: c_green TYPE icon-id VALUE '@08@',
c_yellow TYPE icon-id VALUE '@09@',
c_red TYPE icon-id VALUE '@0A@'.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR qals-matnr, "Material Number
s_werk FOR qals-werk, "Plant
s_art FOR qals-art, "Inspection Type
s_vcdgrp FOR qave-vcodegrp, "Usage Decision Code Group
s_vcode FOR qave-vcode, "Usage Decision Code
s_vdatum FOR qave-vdatum. "Usage Decision Code Date
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_all RADIOBUTTON GROUP g1 DEFAULT 'X',
p_excp RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-009.
"Variant Selection
PARAMETERS: p_vari TYPE disvariant-variant.
SELECTION-SCREEN END OF BLOCK b3.
*& Form select_data
Select Inspection Details
FORM select_data TABLES p_out STRUCTURE wa_out
p_out1 STRUCTURE wa_out.
DATA:l_mncod(30) TYPE c.
REFRESH : i_qals,i_qmsm,i_qmsm_tmp,i_disp,p_out.
SELECT qalsmatnr qalswerk qals~mengeneinh
qalslmenge01 qalslmenge02 qals~lmenge03
qalslmenge04 qalslmenge05 qals~lmenge06
qalslmenge07 qalslmenge08 qals~prueflos
qalsart qalscharg qave~vcode
qavevdatum qmelqmnum
INTO CORRESPONDING FIELDS OF TABLE i_qals
FROM qals
INNER JOIN qave
ON qalsprueflos = qaveprueflos
INNER JOIN qmel
ON qalsprueflos = qmelprueflos
WHERE qals~matnr IN s_matnr
AND qals~werk IN s_werk
AND qals~art IN s_art
AND qals~stat34 EQ 'X'
AND qave~vcodegrp IN s_vcdgrp
AND qave~vcode IN s_vcode
AND qave~vdatum IN s_vdatum.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-008.
ENDIF.
IF NOT i_qals IS INITIAL.
SELECT qmnum manum mncod INTO TABLE i_qmsm
FROM qmsm
FOR ALL ENTRIES IN i_qals
WHERE qmnum EQ i_qals-qmnum
AND mngrp LIKE 'Q_D%'
AND kzloesch NE 'X'.
ENDIF.
***Concatenation of Disposition Codes
IF NOT i_qmsm IS INITIAL.
i_qmsm_tmp = i_qmsm.
SORT i_qmsm_tmp BY qmnum mncod.
DELETE ADJACENT DUPLICATES FROM i_qmsm_tmp COMPARING qmnum mncod+0(2).
CLEAR wa_qmsm.
LOOP AT i_qmsm_tmp INTO wa_qmsm.
MOVE wa_qmsm-qmnum TO wa_disp-qmnum.
CONCATENATE l_mncod wa_qmsm-mncod+0(2) INTO l_mncod SEPARATED BY space.
AT END OF qmnum.
SHIFT l_mncod LEFT DELETING LEADING space.
MOVE l_mncod TO wa_disp-mncod.
APPEND wa_disp TO i_disp.
CLEAR:wa_disp,l_mncod.
ENDAT.
ENDLOOP.
ENDIF.
***Transfer of data to the output table
LOOP AT i_qals INTO wa_qals.
MOVE-CORRESPONDING wa_qals TO wa_out.
CLEAR wa_disp.
READ TABLE i_disp INTO wa_disp
WITH KEY qmnum = wa_qals-qmnum.
IF sy-subrc EQ 0.
MOVE wa_disp-mncod TO wa_out-mncod.
ENDIF.
PERFORM check_quantity USING wa_qals.
CLEAR wa_qmsm.
LOOP AT i_qmsm INTO wa_qmsm
WHERE qmnum EQ wa_qals-qmnum.
PERFORM check_group USING wa_qals
wa_qmsm.
CLEAR wa_qmsm.
ENDLOOP.
IF g_red NE 'X'.
CLEAR wa_qmsm.
LOOP AT i_qmsm INTO wa_qmsm WHERE qmnum = wa_qals-qmnum
AND mncod0(2) NE wa_qals-vcode0(2).
g_yellow = 'X'.
ENDLOOP.
ENDIF.
IF g_yellow EQ 'X'.
MOVE c_yellow TO wa_out-icon.
ELSEIF g_red EQ 'X'.
MOVE c_red TO wa_out-icon.
ELSE.
MOVE c_green TO wa_out-icon.
ENDIF.
APPEND wa_out TO p_out.
CLEAR:wa_qals,wa_out,g_red,g_yellow.
ENDLOOP.
***IF only exceptions are need to be displayed
IF p_excp EQ 'X'.
CLEAR wa_out.
LOOP AT p_out INTO wa_out WHERE icon EQ c_red.
APPEND wa_out TO p_out1.
ENDLOOP.
ENDIF.
ENDFORM. " select_data
*& Form populate_fieldcat
Populate the Fieldcat Table
FORM populate_fieldcat USING p_table TYPE c.
**status
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'ICON'.
wa_fieldcat-seltext_l = text-010.
wa_fieldcat-outputlen = 15.
wa_fieldcat-icon = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
**Material
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_l = text-011.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO i_fieldcat.
**Plant
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'WERK'.
wa_fieldcat-seltext_l = text-012.
wa_fieldcat-outputlen = 7.
APPEND wa_fieldcat TO i_fieldcat.
**Usage Decision
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'VCODE'.
wa_fieldcat-seltext_l = text-013.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO i_fieldcat.
**Dispositions
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'MNCOD'.
wa_fieldcat-seltext_l = text-014.
wa_fieldcat-outputlen = 18.
APPEND wa_fieldcat TO i_fieldcat.
**UOM
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'MENGENEINH'.
wa_fieldcat-seltext_l = text-015.
wa_fieldcat-outputlen = 18.
APPEND wa_fieldcat TO i_fieldcat.
**Unrestricted Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE01'.
wa_fieldcat-seltext_l = text-016.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Scrap Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE02'.
wa_fieldcat-seltext_l = text-017.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Sample Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE03'.
wa_fieldcat-seltext_l = text-018.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Blocked Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE04'.
wa_fieldcat-seltext_l = text-019.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Retain Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE05'.
wa_fieldcat-seltext_l = text-020.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Other Mat Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE06'.
wa_fieldcat-seltext_l = text-021.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**RTV Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE07'.
wa_fieldcat-seltext_l = text-022.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Exp. Scrap Quantity
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'LMENGE08'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-qfieldname = 'MENGENEINH'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Inspection Lot
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'PRUEFLOS'.
wa_fieldcat-seltext_l = text-024.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Inspection Type
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'ART'.
wa_fieldcat-seltext_l = text-025.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Notification
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'QMNUM'.
wa_fieldcat-seltext_l = text-026.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Date
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'VDATUM'.
wa_fieldcat-seltext_l = text-027.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
**Batch
CLEAR wa_fieldcat.
wa_fieldcat-tabname = p_table.
wa_fieldcat-fieldname = 'CHARG'.
wa_fieldcat-seltext_l = text-028.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " populate_fieldcat
*& Form check_quantity
To Check the Quantity
FORM check_quantity USING p_qals TYPE t_qals.
IF wa_qals-lmenge01 GT 0.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND ( mncod CP 'UI'
OR mncod CP 'SR'
OR mncod CP 'ND' ).
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge02 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND ( mncod CP 'SC'
OR mncod CP 'SR' ).
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge04 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND ( mncod CP 'RW'
OR mncod CP 'RD' ).
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge05 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND mncod CP 'R1'.
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge06 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND mncod CP 'RD'.
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge07 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND mncod CP 'RV'.
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
IF wa_qals-lmenge08 GT 0 AND g_red NE 'X'.
LOOP AT i_disp TRANSPORTING NO FIELDS
WHERE qmnum EQ wa_qals-qmnum
AND ( mncod CP 'SC'
OR mncod CP 'SE' ).
ENDLOOP.
IF sy-subrc NE 0.
g_red = 'X'.
ENDIF.
ENDIF.
ENDFORM. " check_quantity
*& Form check_group
To check the Disposition Code
FORM check_group USING p_qals TYPE t_qals
p_qmsm TYPE t_qmsm.
IF p_qmsm-mncod+0(2) EQ 'UI' AND
NOT p_qals-lmenge01 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'RW' AND
NOT p_qals-lmenge04 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'SC' AND
NOT p_qals-lmenge02 GT 0 AND
NOT p_qals-lmenge08 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'SE' AND
NOT p_qals-lmenge08 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'RV' AND
NOT p_qals-lmenge07 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'SR' AND
NOT p_qals-lmenge01 GT 0 AND
NOT p_qals-lmenge02 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'ND' AND
NOT p_qals-lmenge01 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'R1' AND
NOT p_qals-lmenge05 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
IF p_qmsm-mncod+0(2) EQ 'RD' AND
NOT p_qals-lmenge04 GT 0 AND
NOT p_qals-lmenge06 GT 0.
g_red = 'X'.
EXIT.
ENDIF.
ENDFORM. " check_group
*& Form call_alv
Call ALV Grid Display
FORM call_alv TABLES p_out STRUCTURE wa_out.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = i_layout
it_fieldcat = i_fieldcat[]
TABLES
t_outtab = p_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " call_alv
*& Form generate_alv
Build ALV
FORM generate_alv .
IF NOT i_out IS INITIAL OR
NOT i_out1 IS INITIAL.
g_repid = sy-repid.
IF p_excp EQ 'X'.
MOVE 'I_OUT1' TO g_table.
ELSEIF p_all EQ 'X'.
MOVE 'I_OUT' TO g_table.
ENDIF.
PERFORM populate_fieldcat USING g_table.
i_layout-zebra = 'X'.
i_layout-colwidth_optimize = 'X'.
IF p_excp = 'X'.
PERFORM call_alv TABLES i_out1.
ELSEIF p_all = 'X'.
PERFORM call_alv TABLES i_out.
ENDIF.
ENDIF.
ENDFORM. " generate_alv
*& Form PF_STATUS_SET
Setting PF Status
FORM pf_status_set USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS1' .
ENDFORM. "PF_STATUS_SET
*& Form USER_COMMAND
User Command Processing
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'UDG'.
IF p_all EQ 'X'.
CLEAR wa_out.
READ TABLE i_out INTO wa_out INDEX rs_selfield-tabindex.
SET PARAMETER ID 'QLS' FIELD wa_out-prueflos.
ELSEIF p_excp EQ 'X'.
CLEAR wa_out1.
READ TABLE i_out1 INTO wa_out1 INDEX rs_selfield-tabindex.
SET PARAMETER ID 'QLS' FIELD wa_out1-prueflos.
ENDIF.
CALL TRANSACTION 'QA13' AND SKIP FIRST SCREEN.
WHEN 'QNF'.
IF p_all EQ 'X'.
CLEAR wa_out.
READ TABLE i_out INTO wa_out INDEX rs_selfield-tabindex.
SET PARAMETER ID 'IQM' FIELD wa_out-qmnum.
ELSEIF p_excp EQ 'X'.
CLEAR wa_out1.
READ TABLE i_out1 INTO wa_out1 INDEX rs_selfield-tabindex.
SET PARAMETER ID 'IQM' FIELD wa_out1-qmnum.
ENDIF.
CALL TRANSACTION 'QM03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form variant_init
Initialize variant
FORM variant_init .
Set Options: save variants userspecific or general
g_save = 'A'.
g_report = sy-repid.
g_var-report = g_report.
Get default variant
g_variant = g_var.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = g_variant-variant.
ENDIF.
ENDFORM. " variant_init
*& Form f4_for_variant
F4 help for variant
FORM f4_for_variant .
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_var
i_save = g_save
IMPORTING
e_exit = g_exit
es_variant = g_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF g_exit = space.
p_vari = g_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " f4_for_variant
*& Form pai_of_selection_screen
Check existence of Variant
FORM pai_of_selection_screen .
IF NOT p_vari IS INITIAL.
MOVE g_var TO g_variant.
MOVE p_vari TO g_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_variant.
g_var = g_variant.
ELSE.
PERFORM variant_init.
ENDIF.
ENDFORM. " pai_of_selection_screen
*& Form get_codegroup
Get F4 help for Code Group
FORM get_codegroup .
DATA: i_return TYPE TABLE OF ddshretval.
SELECT katalogart codegruppe kurztext FROM qpgt
INTO TABLE i_codegrp
WHERE katalogart EQ '3'
AND sprache EQ sy-langu.
IF sy-subrc EQ 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'CODEGRUPPE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_VCDGRP'
value_org = 'S'
TABLES
value_tab = i_codegrp[]
return_tab = i_return[]
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.
ENDIF.
ENDFORM. " get_codegroup
*& Form get_code
Get F4 help for Code
FORM get_code .
DATA: l_field TYPE rsscr-name VALUE 'S_VCDGRP',
l_field_kind TYPE rsscr-kind VALUE 'S',
li_par_values TYPE TABLE OF rsparams,
la_par_values TYPE rsparams,
r_cdgrp TYPE RANGE OF qpct-codegruppe,
la_cdgrp LIKE LINE OF r_cdgrp.
**Get the values entered in the selection screen
PERFORM f4_get_related_values IN PROGRAM rsdbspf4
TABLES li_par_values
USING l_field l_field_kind.
IF NOT li_par_values IS INITIAL.
CLEAR:la_cdgrp,la_par_values.
LOOP AT li_par_values INTO la_par_values.
MOVE-CORRESPONDING la_par_values TO la_cdgrp.
IF la_cdgrp-option IS INITIAL.
MOVE 'EQ' TO la_cdgrp-option.
ENDIF.
APPEND la_cdgrp TO r_cdgrp.
CLEAR la_cdgrp.
ENDLOOP.
ENDIF.
SELECT katalogart codegruppe
code version
kurztext FROM qpct
INTO TABLE i_code
WHERE katalogart EQ '3'
AND codegruppe IN r_cdgrp
AND sprache EQ sy-langu.
IF sy-subrc EQ 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'CODE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'S_VCODE'
value_org = 'S'
TABLES
value_tab = i_code[]
return_tab =
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.
ENDIF.
ENDFORM. " get_code -
Can Anyone help to explain why character \ is used in Route pattern.
Can Anyone help to explain why character \ is used in Route pattern. also if you could explain *11\+1.289201XXXX ?
Well, I think the proper characterization would be that the design is based on a loose interpretation of RegEx. For instance, the asterisk "*" is typically used as the directive for zero or more occurrences of the preceding character. In the UCM dial plan, the * is a valid digit and someone decided to avoid the nastiness of escaping asterisk every time it is needed. On a related point, in standard regex build the "?" is used for a 0 or 1 match. In UCM, the "?" is 0 or more (so, it is like the asterisk in that way).
That said, I get your point. Someone says "hey, we need wild cards" and the likely place to start pulling examples is RegEx.
HTH
-Bill
(b) http://ucguerrilla.com
(t) @ucguerrilla
Please remember to rate helpful responses and identify helpful or correct answers.
Maybe you are looking for
-
How can I skin the TextLayout scrollbar?
I've been searching online for hours about how to skin the scrollbar component thats embedded in the TextLayout component. I'm using Flash CS4 and Actionscript 3. I'm guessing it is very similar to skinning other components, but it doesn't seem to wo
-
Business One for Fuel Marketing and Transportation
I have a prospect who requires a system to handle marketing and transportation of petroleum based fuels. Has anyone dealt with this scenario before?
-
I want to purchase the full version after using my 30 day trial. I am not able to complete order in the app store as it states the app is already installed and askes to check for updates in Apple menu. No updates are available and I am not sure what
-
I WANT MEMBERSHIP BUT I WANT TO PAY THE SUBSCRIPTION IN INDIAN RS. IS IT POSSIBLE?
I am an indian and from the city of KOLKATA. I want to learn Adobe Photoshop. From where should I start. Due to slow Internet connectivity. I could not download products and also could not make payment. Is there is any alternate arrangement for getti
-
Hello friends, Iam creating one BS and one TS. I already Imported my BS to ID. But problem is Create Receiver Communication channel that BS is not ACTIVATED. whe iam trying to activate it this following error displyed. Logical system SD1CLNT50 alrea