FPM - Check Mandatory Fields
Hi,
Could you please let me know, how can I do the required fields check in FPM?
I can do this requirement in a simple webdynpro application as below:
lo_view_controller = wd_this->wd_get_api( ).
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING view_controller = lo_view_controller
IMPORTING messages = lt_messages ).
CHECK lt_messages[] IS INITIAL.
Please let me know how can I do the same in FPM?
Thanks,
Vijay.
There is really no guideline about that. You have decided to go for Dynamic UI elements and you have to find a way to validate them that is the price you would pay for doing things in Dynamic programming. You might have to rely on the looping of your UI elements and see if it is state is mandatory and go for validation in a dynamic way. Requires lots of programming and understanding of UI hierarchy.
Similar Messages
-
Strange problem while checking Mandatory fields
Hi ,
I am checking mandatory fields with the method following method.
CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( VIEW_CONTROLLER = my_controller ).
It was working fine for mandatory fields and also showing one extra input field which is not mandatory with red border .
Please tell me how to avoid this and What could be the problem.
Thanks and Best Regards,
VijayHi Vijay,
the extra vield thats showing in re d will be a field that doesnt support blank entry. try commenting the method thats calling CL_WD_DYNAMIC_TOOL.
CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW will check only mandatory fields.. thats for sure.
the error message thats showing on the optional fild is coming from some standard check
Regards
Sarath -
Check mandatory fields before saving
Hello,
In my Z-program, how can I check all mandatory fields in a dynpro before saving?
Is there any function to do that?
Thanks!!!Hi alberto,
1. If the fields are mandatory (as set in the field attributes while designing the screen),
2. then we don't have to write any additional logic for the same.
The system will AUTOMATICALLY check for it, and issue appropriate message.
regards,
amit m. -
Check mandatory fields of view in ViewContainer
Hi Experts!
I created a view (main view) which containes a ViewContainer UI element. After a click on the main view I want to check the mandatory fields (with method check_mandatory_fields onview). But therefore I need the reference to the view controller which is embedded in the ViewContainer element. How can I solve this???
Thanks!Hi
This is how I achieved it:
In DoINIT of the view which is embedded inside view container UI element I got the reference of view controller and stored it as a component controller public attribute
wd_comp_controller->mo_api_controller = wd_this->wd_get_api( ).
Here mo_api_conroller is a comp controller public attr of type ref to if_wd_view_controller.
Now you can call your method like this in the main view
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING view_controller = wd_comp_controller->MO_API_CONTROLLER
display_messages = abap_true
IMPORTING messages = lt_messages
Hope this helps.
Regards
Manas Dua -
Check Mandatory Fields (Dynamic Programming)
Hi All,
I am currently generating UI elements dynamically. I have few elements in these dynamically generated elements which are mandatory. Does anyone has information about how to programmatically check whether the entries have been made before the user is allowed to proceed to the next step? I have maintained the state property of the InputField and the webdynpro application doesnot automatically checks for the entries.
Any help will be greatly appreciated.
Thanks and regards,
HemanthHi Hemanth,
there are at least two ways to do this:
1. Define some simple types in the local dictionary with minLength > 0 and use this simple types as the property types of the context attributes. If you bind the UI elements to this context attributes, the WD runtime will do the checks automatically.
2. Check the contents of the UI elements with required input manually (by checking the contents of the bound context attributes). Use the report(Invalid)ContextAttribute... methods of the <a href="https://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/webdynpro/com/sap/tc/webdynpro/progmodel/api/IWDMessageManager.html">Message Manager API</a> to report missing data.
Hope that helps.
Regards
Stefan
PS: The state property is just a visual indicator for required/not required fields and doesn't trigger any automatic validation. -
Check Mandatory Fields when state is bound with context attribute
Hello All,
Currently i am facing problem in my SAP SRM 7.0 standard component.
Actually, i have to remove mandatory(State = Required) for one of my inputfileds for this I have written below code, but it has been remove only Red mark * infront of Inputfield, after that, i am trying to save other data, still it is asking me enter the required value.
here my input field bound with Context attribute, it is standard attribute.
data:lo_input1 type ref to cl_wd_input_field.
lo_input1 ?= VIEW->get_element( 'NAME_FIRST' ).
lo_input1->set_state( '00' ).
I am trying to delete state = required property from below component and view
Component Name : /SAPSRM/WDC_MOFC_PERSON
View : V_PERSON
Can you help me on this?
Thanks
Sandeep.Hi Baskaran ,
Thanks for ur reply ..
Eveen in that component they have not used cl_wd_dynamic_tool class for mandatory attributes
I want to share another thing with u that is
I am trying it in another way
with the following code which i have done in post exit is
let me explain u what i did
__first of all i got the child node of rootuielementcontaine
later
i get the childnode of container_left and assigned it to another class of ref cl_wd_uielemnent
now where i have struked is
*CALL METHOD LR_CHILD2->GET_CHILD
EXPORTING
ID = 'FORM_OF_ADDRESS_DROPDOWN'
INDEX =
RECEIVING
THE_CHILD = LR_C1.
what the error i am getting is
OBJECTS_OBJREF_NOT_ASSIGNED
Please correct me if there is any wrong inn the code ...
FORM_OF_ADDRESS_DROPDOWN--->ui element dropdown
r__ DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lt_children TYPE cl_wd_uielement=>tt_uielement.
DATA lr_view TYPE REF TO if_wd_view.
DATA lr_child TYPE REF TO cl_wd_uielement.
DATA lr_child1 TYPE REF TO cl_wd_uielement.
DATA lr_child2 TYPE REF TO cl_wd_uielement.
data : LR_CON1 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
data : LR_CON2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
SANDEEP
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lt_children = lr_container->get_children( ).
CALL METHOD lr_container->get_child
EXPORTING
id = 'DATACONTAINER'
index = 1
RECEIVING
the_child = lr_CHILD.
LR_CON1 ?= LR_CHILD.
CALL METHOD LR_CON1->GET_CHILD
EXPORTING
ID = 'CONTAINER_LEFT'
INDEX = 1
RECEIVING
THE_CHILD = LR_CHILD1 .
DATA : LR_CHILD2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
LR_CHILD2 ?= LR_CHILD1 .
*DATA : LR_C1 TYPE REF TO CL_WD_UIELEMENT.
*CALL METHOD LR_CHILD2->GET_CHILD
EXPORTING
ID = 'FORM_OF_ADDRESS_DROPDOWN'
INDEX =
RECEIVING
THE_CHILD = LR_C1.
*DATA : LR_DD TYPE REF TO CL_WD_DROPDOWN_BY_KEY .
*LR_DD ?= LR_C1 .
*CALL METHOD LR_DD->SET_STATE
EXPORTING
VALUE = '00'
sandeep -
Mandatory field on Service Call
Hi Expert,
I would like to make certain fields mandatory on a Service Call. (When Status Closed, a UDF I have added must be populated, if not block the user)
Will I be able to use transaction notifications? If this is the case, would you perhaps have some sample code that will guide me in the process?
Thanks in advance,
AdriaanHi Adriaan,
Use the Validate Item event of the Form_Data_Add and Form_Data_Update event's check mandatory fields.
Regards,
Vítor Vieira -
Check for mandatory fields while creating EP users using code .. :|
Hello All,
I have a code using which I can create user accounts/EP users on Portal, am working on EP6 SP9 & SP12.
<u>My query</u>:
1. <i>From Portal's perspective</i> -> While creating EP users, there are few mandatory fields like user-id, FirstName, LastName, Email-id and Password. If any of the above fields is null/empty, Portal would give us an error message.
2. <i>From coding perspective</i> -> Here, only the user-id is required. Even if I do not enter/fill any of the above mentioned mandatory fields (except user-id), user account is created.
In case wherein FirstName/LastName is not mentioned, Portal shows the userid in the Welcome Frame, i.e. Welcome <user-id>. Tried this by commenting the statements contains the methods related to setting/accepting FirstNme and LastName of user.
<b>I want to know if this is all rite?
If no, then please guide me as to how can I set mandatory fields in my code.</b>
Awaiting Reply.
Thanks and Warm Regards,
Ritu R HunjanHi Ritu,
>>please guide me as to how can I set mandatory fields in my code??
In ur jsp file or in the controls code add the following attribute
<hbj:label id="userIdLabel"
text="User ID"
labelFor="userIdInput"
design="HEADER3"
required="true"/>
and to check the mandatory entry for that field do this in the submit button
<hbj:button id="insert"
text="Submit"
design="emphasized"
onClick="save"
onClientClick="if(!isMandatory()) htmlbevent.cancelSubmit=true;;"/>
and in the javascript write the client validation code.
Hope this helps.
Regards,
Joshua Kiran -
Check duplicate data entry in multi record block,which is a mandatory field
Dear all,
I have a situation where i have to check duplicate data entry(on a particular field,which is a mandatory field,i.e. it cannot be skipped by user without entering value) while data key-in in a Multi Record block.
As for reference I have used a logic,such as
1>In a When-Validate-Record trigger of that block I am assigning the value of that current item in Table type variable(collection type)
as this trigger fire every time as soon as i leave that record,so its assigning the value of that current time.And this process continues
then
2>In a When-Validate-Item trigger of that corresponding item(i.e. the trigger is at item level) has been written,where it compares the value of that current item and the value stored in Table type variable(collection type) of When-Validate-Record trigger.If the current item value is matched with any value stored in Table type variable I am showing a message of ('Duplicate Record') following by raise_form_trigger failure
This code is working fine for checking duplicate value of that multi record field
The problem is that,if user enter the value in that field,and then goes to next field,enter value to that field and then press 'Enter Query 'icon,the bolth Validate trigger fires.As result first when-validate record fires,which stores that value,and then when-validate-item fires,as a result it shows duplicate record message
Please give me a meaningful logic or code for solving this problem
Any other logic to solve this problem is also welcome@Ammad Ahmed
first of all thanks .your logic worked,but still i have some little bit of problem,
now the requirement is a master detail form where both master and detail is multirecord ,where detail cannot have duplicate record,
such as..........
MASTER:--
A code
A1
A2
DETAIL:--
D code
d1
d2 <-valid as for master A1 , detail d1 ,d2 are not duplicate
d2 <--invalid as as for master A1 , detail d2 ,d2 are duplicate
validation rule: A Code –D Code combination is unique. The system will stop users from entering duplicate D Code for a A Code. Appropriate error message will be displayed.*
actually i am facing a typical problem,the same logic i have been applied in detail section ,its working fine when i am inserting new records.problem starts when i query,after query in ' a ' field say 2 records (i.e. which has been earlier saved) has been pasted,now if i insert a new record with the value exactly same with the already present value in the screen(i.e. value populated after query) its not showing duplicate.................could u tell me the reason?and help me out...............its urgent plzzzzzzzzz
Edited by: sushovan on Nov 22, 2010 4:34 AM
Edited by: sushovan on Nov 22, 2010 4:36 AM
Edited by: sushovan on Nov 22, 2010 8:58 AM -
Hi,
We have upgraded to CRM 7.0.
We have placed mandatory check on some fields in service tickets in UI. But the mandatory checks work in a wired way.
For example if I am in Interaction History work center where we have marked partner as mandatory field for search.
But If I do not perform any search and try to navigate to the other workcenter the system throws a mandatory check error.
Is this the standard behaviour in CRM 7.0.
Regards
YogeshHi Gopi,
Why do you want to perform the checks on Serverside event....why not on client side event ie. onClientClick ?
For validations on serevr side event onClick you can use the method
Data: it_fields type it_fields TYPE tihttpnvp .
CALL METHOD request->get_form_fields
CHANGING
fields = it_fields.
This table it_fields contains values of all the elements in the form.
Hope it helps.
Regards,
Anubhav. -
Removing mandatory field checks
Hi all
We are working on ESS/MSS packages customization and we have a requirement where in we need to make a mandatory field in one of the screens, non-mandatory e.g. zip code in address information. I have the Webdynpro code of mentioned screen in my NWDS. Any pointers are welcome.
with thanks
amitHi amit,
The state of a webdynpro element can be set using
void setState(WDState value) in the implementation of your view.
Check the
IWDAbstractInputField
in
<a href="https://help.sap.com/javadocs/NW04S/current/wd/index.html">WDAPI</a>
Attributes available
static WDState NORMAL
The normal state of a UI element.
static WDState REQUIRED
Indicates that a UI element must provide a value for performing a certain action.
Thanks,
Swathi -
Mandatory field in COPA characteristic group not checked
Hello,
I have customized a COPA characteristic group in KEPA transaction entering the product as a mandatory characteristic.
Then I have posted a document in FBD9 taking a reference document that does nor have filled the product and the system does not show an error and the document is posted without the mandatory field.
How could I solve this problem?
Thank you very much
RegardsHi
Did you assign this char group in KE4G against your Busn Trans or in KEVG2 against record type B?
If yes, and still it is not reading it, then refer note 115500.. you may need to apply this note
Regards
Ajay M -
What are the mandatory fields while creation of material master in differen
what are the mandatory fields while creation of material master in different views?
Hi Gopi,
This is purely depends on the function configuration, which would be done MM consultants. Kindly check with them.
thanks & regards
Kishore Kumar Maram -
What are the Mandatory Fields in Transaction ME51
Hello Seniors,
I have a requirement about purchase order creation. In this process, I am using the BAPI named " BAPI_PO_CREATE1 ". I have passed all the fields but when I debug and look into the internal tables, I couldn't find certain records. I even debugged " bapiret2" and I see an error which reads "" All mandatory fields are missing"". I have even created a PO in ME51 and found out the mandatory fields but in vain. BAPIRET2 still says, there are some more mandatory fields missing. I need to know what are all the mandatory fields to create a Purchase order using TCODE - ME51.
Your reply is most awaited and rewarded.
Thanks and Regards,
MARKIVhi ,
Functionality
Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).
Alternatively, the IDoc type PORDCR1 is available. The data from this IDoc automatically populates the interface parameters of the function module BAPI_PO_CREATE1.
Functionality in Detail
Authorization
The following authorization objects are checked when an Enjoy purchase order is created (activity 01):
M_BEST_BSA (document type in PO)
M_BEST_EKG (purchasing group in PO)
M_BEST_EKO (purchasing organization in PO)
M_BEST_WRK (plant in PO)
Controlling adoption of field values via X bar
For most tables, you can determine via your own parameters in the associated X bar in each case (e.g. PoItemX) whether fields are to be set initial, values inserted via the interface, or default values adopted (e.g. from Customizing or master records) (for example, it is not mandatory to adopt the material group from an underlying purchase requisition - you can change it with the BAPI).
Transfer
Header data
The header data of the Enjoy purchase order is transferred in the table PoHeader.
Item data
The item data of the Enjoy purchase order is stored in the table PoItem (general item data). The delivery schedule lines are stored in the table PoSchedule.
Use the table PoAccount to specify the account assignment information. If account assignments have been specified for services and limits, you show the relevant account assignment line in PoAccount in the table PoSrvAccessValues via the package number of the service or the limit.
Services and limits
Services, free limits and limits with contract reference can be specified in the tables PoServices, PoLimits, and PoContractLimits.
Conditions
Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.
Vendor and delivery address
The vendor's address can be specified individually in the table PoAddrVendor; the delivery address in the table PoAddrDelivery. If you do not make any individual specification, the fields will be populated via the central address managementfacility.
Note
In this method, the following restrictions apply with regard to addresses:
Addresses can only be created with this method - they cannot be changed. You can only change address data with the method BAPI_ADDRESSORG_CHANGE.
When you create addresses, they are not checked by the method. An Enjoy purchase order may therefore contain faulty address data.
Partner roles
The partners can be maintained individually via the table PoPartner (with the exception of the partner role "vendor").
Import/export data
Import/Export data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items.
Texts
Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText.
Version Management
You can make use of the Version Management facility via the table AllVersions.
Return
The PO number is returned in the parameter ExpPurchaseOrder. In addition, all information except the service and export/import tables is placed in the output structures.
Return messages
Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
Example
Example of population of BAPI interface in the Function Builder
Parameter: POHEADER
COMP_CODE = 1000
DOC_TYPE = NB
ITEM_INTVL = 00001
VENDOR = 0000001000
PMNTTRMS = 0001
PURCH_ORG = 1000
PUR_GROUP = 001
CURRENCY = EUR
Parameter: POHEADERX
COMP_CODE = X
DOC_TYPE = X
ITEM_INTVL = X
VENDOR = X
PMNTTRMS = X
PURCH_ORG = X
PUR_GROUP = X
Parameter: POITEM
PO_ITEM = 00001
MATERIAL = 100-100
PLANT = 1000
STGE_LOC = 0001
QUANTITY = 15.000
TAX_CODE = V0
ITEM_CAT = 0
ACCTASSCAT = K
Parameter: POITEMX
PO_ITEM = 00001
MATERIAL = X
PLANT = X
STGE_LOC = X
QUANTITY = X
TAX_CODE = X
ITEM_CAT = X
ACCTASSCAT = X
Parameter: POSCHEDULE
PO_ITEM = 00001
SCHED_LINE = 0001
DELIVERY_DATE = 02.12.2002
QUANTITY = 6.000
PO_ITEM = 00001
SCHED_LINE = 0002
DELIVERY_DATE = 03.12.2002
QUANTITY = 5.000
PO_ITEM = 00001
SCHED_LINE = 0003
DELIVERY_DATE = 04.12.2002
QUANTITY = 4.000
Parameter: POSCHEDULEX
PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0002
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0003
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
Parameter: POACCOUNT
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = 15.000
GL_ACCOUNT = 0000400000
COSTCENTER = 0000001000
CO_AREA = 1000
Parameter: POACCOUNTX
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = X
GL_ACCOUNT = X
COSTCENTER = X
CO_AREA = X
Parameter: POCOND
ITM_NUMBER = 000001
COND_ST_NO = 001
COND_TYPE = PB00
COND_VALUE = 79.900000000
CURRENCY = EUR
CURRENCY_ISO = EUR
COND_UNIT = KG
COND_P_UNT = 1
CHANGE_ID = U
Parameter: POCONDX
ITM_NUMBER = 000001
COND_ST_NO = 000
ITM_NUMBERX = X
COND_TYPE = X
COND_VALUE = X
CURRENCY = X
CHANGE_ID = X
Parameter: POPARTNER
PARTNERDESC = OA
LANGU = EN
BUSPARTNO = 0000001100
PARTNERDESC = GS
LANGU = EN
BUSPARTNO = 0000001200
PARTNERDESC = PI
LANGU = EN
BUSPARTNO = 0000001000
Help in the Case of Problems
1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
Customer Enhancements
The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
EXIT_SAPL2012_001 (at start of BAPI)
EXIT_SAPL2012_003 (at end of BAPI)
The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
EXIT_SAPL2012_002 (at start of BAPI)
EXIT_SAPL2012_004 (at end of BAPI)
These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
Further information
1. Note 197958 contains up-to-date information on the purchase order BAPIs.
2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
regards
reena -
Hello,
i've a editbale alv grid.
Is it possible to set a field/colum as mandatory field?
Best regards,
TomSdHi,
Have a look at the report BCALV_EDIT_03.
In this report the program logic is such that if the user enters an incorrect value an error is displayed.
Instead you can check if the field of your ALV filelds are null and validate them accordingly.
Regards,
Sandeep
Maybe you are looking for
-
JS for search and creation of automated hyperlinks from the results
Hi, Is it possible to create a javascript that searches a PDF document for a part of phrase (with regexp) and then creates a hyperlink of the whole row where the phrase is? I'll explain a little bit more.... In a PDF catalog I have part numbers of 10
-
Hi I have a scenario where i have to create the file-soap synchronous how we achieve that 1. Do i have to create the outbound message syn for file venkat
-
Phone number appearing in Favorites list but does not exist in Contacts
I have an iPhone 4S, running iOS 5.1.1 (9B206). About two weeks ago (not really sure when I noticed) a phone number appeared at the bottom of my Favorites list. The number is for a person that I deleted from Contacts some months ago. The number is no
-
Remove leading zeros coming from Active Directory
Greetings all. Our sapusername is stored in Active Directory with leading zeros. Is there a way to remove these zeros in the portal so SSO will work? I have had my AD team manually remove the zeros in front of my sapusername, so I'm sure that's th
-
I have a JPG that I have imported on to final cut, I want to make it move around etc. I remember doing it once a while ago but I can't for the life of me remember how, Think I was messing with the wireframe or something? Any ideas?