UDF for Checking the field value
Hi
I want to check the whether the fiels conatins any value or not in mapping ... if not i want to raise the exception using the UDF
DO any one have sample code for writing the UDF
SV
Hi SV
what is your requirement first that should br clear.
i am giving you two UDF
1) i have written this uDF for string and comparing the field value XYZ
2) i am entering a string and its returning aa string which starts from the index of your input fixed length
int len = a.length();
String res = "";
String temp = "";
if ( len >= 10)
temp = a.substring(0,10);
if ( temp.equals("XYZ"))
res = temp;
else
res = "";
return res;
=======================================
String fixed = "ABCD";
String res = "";
int index = -1;
index = a.indexOf(fixed);
if (index == -1)
res = "NO INDEX FOUND";// or if u wanna set it as null res = "";
else
res = b.substring(index4,index12);
return res;
===
hope these may solve your problem
Thanks
Sandeep sharma
If helpful reward points
Similar Messages
-
T.Code for checking the total value of a material
Hi Experts,
Can anybody tel me the T.code for checking the total value of a material which is procured in a specified period?
Thanks in advance
ChannaRefer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get PO-GRN-INVOICE Qty & Value details
Last button on Application tool Bar it is in line of filter, total etc icons
Also check below reports :
MC$G - PURCHIS: Material PurchVal Selection
MC$0 - PURCHIS: PurchGrp PurchVal Selection
MC$< - PURCHIS: MatGrp PurchVal Selection
MC$4 - PURCHIS: Vendor PurchVal Selection -
Hi
I have a scenario where i have to check the amount value sholuld be greater than Zero or not, if it is not greater than zero i have to raise an exception and skip that record ..
i wanna do that using UDF..How we do that
venkatHi paul
I need to Import Any Java packages .
It s giving Error :
Source code has syntax error: /usr/sap/D06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map08e7dc10452d11dcb4a1e210bc394725/source/com/sap/xi/tf/_MM_ACEAwardInformation_to_TaxBalances_.java:113: operator > cannot be applied to java.lang.String,int if(Amount>0)
My code
public String AmountValue(String Amount,Container container){
int AmountValue =Integer.parseInt( Amount);
try{
if(Amount>0)
create record;
else throw new Throwable("Records not greater than 0...");
}catch(Throwable t){}
venkat -
Hi,
I am getting the 4 fields of data in single field from souce system, i need to send to target side with 4 Diffrent Fields. I want to separate the data based on (/).
I think for this I need 4 UDF's, Pls let me know the UDF's for this requirement. I am new to UDF's.
Example :
Source Field:
EmpNo / EmpName / EmpAddress / EmpPhone
Target fields:
EmpNo
EmpName
EmpAddress
EmpPhnoe
Mapping
EmpNo / EmpName / EmpAddress / EmpPhone -
> EmpNo
EmpNo / EmpName / EmpAddress / EmpPhone -
> EmpName
EmpNo / EmpName / EmpAddress / EmpPhone -
> EmpAddress
EmpNo / EmpName / EmpAddress / EmpPhone -
> EmpPhone
Regards,
Pasi.Hello,
I think for this I need 4 UDF's, Pls let me know the UDF's for this requirement. I am new to UDF's.
Not sure about PI 7.0 and below, but for PI 7.1 you can create a context type UDF with four result sets
Argument: input
Result: empNo
Result: empName
Result: empAddress
Result: empPhone
UDF code is:
String temp[] = input[0].split("/");
empNo.addValue(temp[0]);
empName.addValue(temp[1]);
empAddress.addValue(temp[2]);
empPhone.addValue(temp[3]);
Mapping is like this:
Source -> UDF -> EmpNo
|---> EmpName
|---> EmpAddress
|---> empPhone
Hope this helps,
Mark -
How to Check the total value of a field
Hi,
I want to check the total value of a field (this total is obtain by using property of that field thru personalization).
that means , in a table 3 columns are there (col 1, col2 & col3). I personalized the total property as true for col3.
now i'm getting the total for that field.
I want to check that total whether it crossed 100 or not.
How to do this?
Thanks in advance,
SANHi San,
You can achieve by using OATotalRowBean, search for OATotalRowBean in this forum you should be able to get some sample code.
public class OATotalRowBean
extends TotalRowBean
implements OAWebBean, OAWebBeanConstants
A special row rendered at the bottom of a table which lets users see totals for columns which are designated for summing.
Note The total is calculated and displayed only for visible rows.
When you indicate that you want to total one or more columns, the OA Framework creates an OATotalRowBean and designates it as the columnFooter named child of the OATableBean. If the OATableBean is also configured to insert rows (so it has an "Add Another Row" button), then the total bean becomes an indexed child of the add table row bean (see OAAddTableRowBean), which the OA Framework in turn designates as the table's columnFooter object.
If you need to access the table's column footer object for any reason, call the OATableBean's getColumnFooter() method. If row insertions are enabled, this method returns an OAAddTableRowBean; otherwise it returns an OATableRowBean.
For detailed information about creating and working with tables, see OA Framework Developer Guide: Tables.
With regards,
Kali.
OSSi. -
Table for checking the appended fields in the standard extractor
Hello,
Please let me know the table name for checking the appended fields in the standard extractor.
Thanks in advanceHello,
From Rsa6 , goto your extractor from there you may get the name of your strucutre
Go to DD03L and enter this name
And you get to see all the fields there..
waiting for your feedback.
Regards
Nitin Bhatia -
How to get the Output File Name as One of the Field Value From Payload
Hi All,
I want to get the Output file name as one of the Field value from payload.
Example:
Source XML
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_TEST xmlns:ns0="http://sample.com">
- <Header>
<NAME>Bopanna</NAME>
</Header>
</ns0:MT_TEST>
I want to get the Output file name as " Bopanna.xml"
Please suggest me on this.
Regards
BopannaHi,
There are couple of links already available for this. Just for info see the below details,
The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
// Description: Function to create dynamic Filename
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
conf.put(key,a);
return "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
conf.put(key,a);
return "";
With this udf map it with the MessageType as
(File Name field from Payload) > DynamicFileConfiguration>MTReceiver
Thanks
Swarup -
Entry in field Funds Center required; check the field control Mg No.FMEF010
Hi,
We have a Z tcode for converting planned order to purchase requisition.
We use Account assignment P - Project and A - Asset.
We have WBS element and fund center linked to it.
For the Z tcode while converting Planned order to purchase requisition we are getting below error
Error: Entry in field Funds Center required; check the field control Msg No.FMEF010
While creating manually purchase requisition with same GL code and WBS element the fund center gets automatically picked.
Can anyone pls let me know in which table we can find the link between WBS element and fund center so that we can code the same in our program. In PRPS table we can find the link between WBS and profit center.
Or is there any user exit that can be used.
Thanks in advance.
Regards,
RadhaHello
If you do a F1 in the value date field it will give you the answer - The value date is used in bank accounts and bank sub-accounts.
As regards the other query check whether the tax code has been already created.
Hope it helps.
Rgds -
Hi Friends
Can anyone help me to create UDF for Checks for payment form (header level).
regards
kamleshDear Kamlesh,
I am sure you can't add it since some tables in SAP B1 like OCHO can't be added a UDF and make the field inactive or hide (form setting is disable). One way out is to add UDF via addon. SAP support told me about this when I was asking how to add UDF in process external bank statement (OBNK table).
Rgds, -
Add UDF for checks for payments
Hello all:
I was trying to create UDF for checks for payments. but I tried (checks, paid document, credit) under the payment and nothing seems to be working.
Is it possible to create UDF for checks?? If not is there a walk around??
BTW the version is 8.8 SP00 PL14 FX1
Sincerely Yours
Edited by: Bo Peng on Oct 22, 2010 2:57 PMHi,
Not possible to create user defined filed in checks for payment document. Work around is try to use unused filed in the checks for payment document Signature field for example.
M. Senthil -
BADI / USER-EXIT FOR DEFAULTING THE FIELD VTTK-TNDR_ACTC IN TCODE VT01N
Hi,
I require a BADI / USER-EXIT for defaulting the field VTTK-TNDR_ACTC(Currency of Actual Shipment costs) to 'EUR' in transaction VT01N(Shipment Transaction) .
Please could anyone help me with this .
Regards,
Sushanth H.S.Hi!
User Exits in Transportation
In Transportation, there are enhancements that you can use with transaction CMOD.
For a detailed description of the individual enhancements, see the documentation on the individual enhancements or function modules in transaction SMOD.
You can display all enhancements that are available for the area of transportation by choosing F4 in the Enhancement field. Enter V56* in the Enhancement field and choose Execute. Enter V54* to get a list of all enhancements for the area of shipment cost processing.
Business Add-Ins in the transports
Business add-ins (BADIs) are predefined user exits. They enable businesses, partners, and customers to add additional softward to the SAP source code. The linkup of SAP's New Dimension Products, such as APO and BW, to the standard system is thus possible.
Customer-specific functions can be executed before the save time and after the database update.
The following methods are available for the BADI with the definition name 'BADI_LE_SHIPMENT':
AT_SAVE: BADI is called up at the time of the save. Checks and return to dialog are possible.
BEFORE:_UPDATE: BADI is called up right before the data is saved to the database, that is, when all the data is available (for example, internal ly assigned shipment number).
IN_UPDATE: BADI is called up after the database update.
Standard Settings
Creating a BADI method:
Call up transaction SE19. Enter a name of your choice. Choose "create" and in the dialog box enter the definition name 'BADI_LE_SHIPMENT'. Afterwards, enter a short text for implementation. Save the BADI.
On the tab page 'Interface', choose the method for implementation by double-clicking on it. Now you can enter your customer-specific program code. Save and activate the code. You can acess the transmission parameters entered in the BADI definition. With the method ***_AT_SAVE you can initiate the exception ERROR_WITH_MESSAGE (description 'An error message has occurred' ) if you wish to return to the dialog.
Afterwards, go to the heading and activate the interface.
Regards
Tamá -
Display a message in a For Loop with field value
Hello All,
pls,i wanna display a message in a For Loop with field value the code is:
FOR Q1 IN GET_SUM_EXP_QUANTITY LOOP .
INSERT INTO PLN_PLAN_DISTRIBUTION_WAY
(FIN_YEAR_CODE , MONTH_CODE , MATERIAL_CODE , DISTRIBUTION_WAY , EXPECTED_QUANTITY , GROUP_CODE)
VALUES (:PLN_PLAN.FIN_YEAR_CODE , TO_CHAR(V_FROM_DATE,'MM') , Q1.MATERIAL_CODE , 1 , V_MONTHLY_QTY , Q1.GROUP_CODE);
MESSAGE(':PLN_PLAN.FIN_YEAR_CODE'||:PLN_PLAN.FIN_YEAR_CODE ||' '||'V_FROM_DATE = '||TO_CHAR(V_FROM_DATE,'MM'), 'Q1.MATERIAL_CODE'||' '|| Q1.MATERIAL_CODE||' '||'DISTRIBUTION_WAY'||' = 1'||'EXPECTED_QUANTITY'||' = '|| V_MONTHLY_QTY||'GROUP_CODE'|| ' '|| Q1.GROUP_CODE);
FORMS_DDL('COMMIT');
How 2 display a message with the value:
Q1.MATERIAL_CODE
Q1.GROUP_CODE
message(Q1.MATERIAL_CODE)
gave me numeric or value error on run time when pressed on button
Regards,
Abdetu..Thanks 4 reply..
again they r in a For Loop as mentioned above...
INSERT INTO PLN_PLAN_DISTRIBUTION_WAY
(FIN_YEAR_CODE , MONTH_CODE , MATERIAL_CODE , DISTRIBUTION_WAY , EXPECTED_QUANTITY , GROUP_CODE)
VALUES (:PLN_PLAN.FIN_YEAR_CODE , V_REPAIR_MONTH , Q1.MATERIAL_CODE , 1 , V_REPAIR_Qty , Q1.GROUP_CODE);
FORMS_DDL('COMMIT');
The fields in bold r required to be displayed for testing puposes..
this gives me numeric or value error in runtime..
Best regards,
Abdetu.. -
Create Excel file in application server but the field value is incorrect
Hi Experts,
i am facing a problem when create excel file in application server using OPEN DATASET command.
the internal table have 4 field and one of those field contains 19 digit number --> ICCID.
the code running well, successfully create EXCELfile in application server but the problem is SAP only copy exactly first 15 digit numeric only and the rest became zero 0
Example :
the field value in internal table is 8962118800000447654 but when i opened in the excel file the value became 8962118800000440000.
and if i add alphabet like a8962118800000447654 then it is correct.
is there is anything wrong with my code?
here is my code
CONSTANTS: c_tab TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab. "Tab Char
Data : begin of lt_zdsdmmdt00005 occurs 0,
SERNR (18) type c,
MSISDNl(20) type c,
BOX1 (20) type c,
ICCID(30) type c,
end of lt_zdsdmmdt00005.
data : ld_temp(100) type c.
i_file = '/usr/sap/DM/test_excel.xls'.
open dataset i_file for output in legacy text mode.
loop at lt_zdsdmmdt00005.
move lt_zdsdmmdt00005-ICCID to ld_iccid .
concatenate lt_zdsdmmdt00005-sernr lt_zdsdmmdt00005-MSISDN lt_zdsdmmdt00005-BOX1 ld_iccid
into ld_temp separated by c_tab.
transfer ld_temp to i_file.
endloop.
close dataset i_file.
Best Regard,
Akbar.Hi Naveen,
thanks for your reply,
i already tried and the result still the same. any idea?
Best Regard,
Akbar. -
Visio 2010 Validation for Checking the number of a specific type of shape.
I have written a rule for flowchart for checking the number of Start/End Shapes in a document.
The FilterExpression is as follows:
AGGCOUNT(FILTERSET(SHAPESONPAGE(), HASCATEGORY("Start/End"))) > 0
The TestExpression is as follows:
AGGCOUNT(FILTERSET(SHAPESONPAGE(),HASCATEGORY("Start/End"))) = 2
(Since totally there are 2 shapes: 1 Start and 1 End Shape)
However, it is not working. Can anybody tell me what is wrong in the expressions.Well, it worked for me, so I want to check that you modified the Start/End master to have the User.msvShapeCategories row with the value "Start/End", as I did?
A Category is not a Master
David J Parker MVP (Visio) http://blog.bvisual.net -
Tcode for checking the Maintenance Plan
Hello,
I want the transaction code for checking the list of maintenance plan for a particular plant. I went thru tcode IP03, IP16 but could not find the option of plant there..
Kindly guide..
Regards,
NarenNaren,
As stated above, there isn't a plant field in the maintenance plan (only maintenance item, hence the reference ot IP17)
However, it is quite common to use the maintenance plan Sort field as a plant field by customising the table settings for each plant.
PeteA
Maybe you are looking for
-
Cannot find AirPrint printer PhotoSmart 6510
I want to add a new HP6510 wireless printer onto my iMac, iPad2 and iPhone 4s, but it does not appear in either the list of printers in settings or list of AirPrint printers. I have an iMac running Lion (OS X v 10.7.2), and both iPad and iPhone are u
-
~9GB Footage = 42GB with iMovie import..
I recently bought a Canon Vixia HF S20 camcorder which has a built in memory of 32GB. I took some footage on the camcoder for approx 41 minutes. In the quality of movie I am recording the 32GB gives me 2hours and 55 minutes of recording time on the c
-
Forms and reports server issue
Hai iam new to oracle applications.i was asked to solve this issue . i get the error when i start the oracle applications.i get the error in the forms,report and apache webserver. the file parameter.config could not be located or read. for that the s
-
Slow to see tree in Win98 using 3.40 client
I see other posts here mentioning not being able to see the tree using the NetWare 3.4 client with Windows 98. Unfortunately, I seem to have a different problem. At first I cannot see the tree, but if I wait a few minutes (without doing anything), I
-
IDVD slideshows crash Mac DVD Player
So, I created my movie in iMovie, exported it to iDVD 8, and then I added two slideshows. One slideshow has 110 pictures and the other slideshow has about 12 pictures. Both slideshows play perfectly in iDVD preview mode and on my Panasonic DVD player