on 02-09-2006 10:38 PM
Hello,
I am using Bapi_Goodsmvt_Create to post material documents. When I display input view the first time the Qty input field is blank as desired. Once I have posted document the user has option to post another movement. With this option I initialize the all values for Bapi_Goodsmvt_Create.
Example:
wdContext.currentGoodsmvt_ItemElement().setEntry_Qnt(null);
When the input view is displayed it contains "0" rather then being blank.
Any ideas how to initialize the Qty field so that field is empty?
Rgds,
Keith L.
Keith,
Seems that the only way is to re-create node element with fresh model object (Bapi_Goodsmvt_Create) and then populate new model object with attributes of previous one (except Qty).
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Valery,
Here is the code I am using. Values are set back to initial but qty field still contains "0".
wdContext.currentGoodsmvt_ItemElement().setMaterial(null);
wdContext.currentGoodsmvt_ItemElement().setEntry_Qnt(null);
wdContext.currentGoodsmvt_ItemElement().setEntry_Uom(null);
wdContext.currentGoodsmvt_ItemElement().setBatch(null);
wdContext.currentGoodsmvt_ItemElement().setCostcenter(null);
wdContext.currentGoodsmvt_ItemElement().setOrderid(null);
wdContext.currentGoodsmvt_ItemElement().setGl_Account(null);
wdContext.currentGoodsmvt_ItemElement().setPlant(null);
wdContext.currentGoodsmvt_ItemElement().setStge_Loc(null);
wdContext.currentGoodsmvt_ItemElement().setMove_Type(null);
wdContext.currentGoodsmvt_ItemElement().setGr_Rcpt(null);
wdContext.currentGoodsmvt_HeaderElement().setHeader_Txt(null);
// node<Name>.invalidate();
// node<Name>.bind( new <ModelObject>() );
wdContext.nodeZ_Mm_Wd_Bapi_Goodsmvt_Create_Input().invalidate();
Z_Mm_Wd_Bapi_Goodsmvt_Create_Input Input = new Z_Mm_Wd_Bapi_Goodsmvt_Create_Input();
// Set GM CODE
Input.setGoodsmvt_Code(new Bapi2017_Gm_Code());
IGoodsmvt_CodeNode Gm_Code_Node = wdContext.nodeGoodsmvt_Code();
IGoodsmvt_CodeElement Gm_Code_Element = Gm_Code_Node.createGoodsmvt_CodeElement(new Bapi2017_Gm_Code());
Gm_Code_Element.setGm_Code("03");
// Set default date for posting
Input.setGoodsmvt_Header(new Bapi2017_Gm_Head_01());
IGoodsmvt_HeaderNode Head_01_Node = wdContext.nodeGoodsmvt_Header();
IGoodsmvt_HeaderElement Head_01_Element = Head_01_Node.createGoodsmvt_HeaderElement(new Bapi2017_Gm_Head_01());
Head_01_Element.setPstng_Date(new Date(System.currentTimeMillis()));
// Create new node
Input.addGoodsmvt_Item(Item_Create);
Input.addGoodsmvt_Serialnumber(Serialnumber);
// Bind
wdContext.nodeZ_Mm_Wd_Bapi_Goodsmvt_Create_Input().bind(Input);
Valery,
You solved my problem. Thanks !! I have been looking at this one for many hours..
//// node<Name>.invalidate();
//// node<Name>.bind( new <ModelObject>() );
Final Solution
-
wdContext.nodeGoodsmvt_Item().invalidate();
Bapi2017_Gm_Item_Create Bapi2017_Gm_Item = new Bapi2017_Gm_Item_Create();
IGoodsmvt_ItemElement NewModelelement = wdContext.nodeGoodsmvt_Item().createGoodsmvt_ItemElement(Bapi2017_Gm_Item);
wdContext.nodeGoodsmvt_Item().addElement(NewModelelement);
// Bind to Model
wdContext.nodeGoodsmvt_Item().bind(NewModelelement);
Best Regards,
Keith L.
Hi Keith,
where, You are writing
wdContext.currentGoodsmvt_ItemElement().setEntry_Qntnull);
statement.
are u writing this statement in event handler of 'another documnet' button.
if u did that
try this code in event handler of 'another documnet' button.
wdcontext.currentGoodsmvt_ItemElement().modelobject().setEntry_qnt(null);
Regards
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.