How to create a dicitionary using hash map.
Hi All,
I want to create a dictionary using hash map where in i can add new words and there meaning. I have written some code But I am not happy with this. Can you suggest me how to add the words and there meanings to the hash map.
I am not able to add the words and there meaning to the hash map.
for this i tried creating a dictionary class.
// Using hashmap
import java.util.*;
public class Dictionary
public static void main(String[] args)
// Create a hash map
HashMap hm = new HashMap();
// put elements to the map
hm.put("Abode: ", "Home");
hm.put("Balance: ", "An intrument to measure or weigh");
hm.put("Car: ", "Automobile");
hm.put("Dinner: ","Last meal of the day generally had after evening and before sleeping");
hm.put("Embossed: ", "Engraved kind");
Set set = hm.entrySet();
Iterator i = set.iterator();
while (i.hasNext())
Map.Entry me = (Map.Entry) i.next();
System.out.print(me.getKey() + ": ");
System.out.println(me.getValue());
System.out.println();
}This is the other Dictionary class which i created.
public class Main_Dictionary
public static void main(String[] args)
Content_Dictionary cd = new Content_Dictionary();
cd.getContent_Dictionary("Abode", "Home");
cd.displayValues();
class Content_Dictionary
String word, meaning;
Content_Dictionary()
word = "a";
meaning = "b";
Content_Dictionary(String x, String y)
word = x;
meaning = y;
void getContent_Dictionary(String w, String m)
word = w;
meaning = m;
void displayValues()
System.out.print(word + ": ");
System.out.println(meaning);
}If i create an interface containing all the words and there meaning
public interface Words_Dictionary
String Abode = "Home";
String Dark = "Lacking brightness";
String Balance = "An intrument to measure or weigh";
String Car = "Type of Automobile";
String Dinner = "Last meal of the day";
String Embossed = "Engraved kind";
String Adroit = "SkillFul";
}and then create a another class which implements this interface, but how should i add these words and there meaning in the hashmap.
I tried creating word document but i was unable to
figure out how to do the operations on the word
document and its content,
So This is what i could come up with, i just created
one class Dictionary , now I am able to search for
the meaning of the word specified by me, and I am
able to print all the words and there meanings added
to the hashmap, but i am not able to figure out how
to add a new word and the meaning in the hashmap and
how to find is a word is there or not...May I suggest a slightly different approach?
Do not create a String ==> String mapping, but a String ==> List<String> mapping. And do NOT place everything inside your main method.
Here's a small demo:
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
public class Dictionary {
private Map< String, List<String >> dictionary;
public Dictionary() {
dictionary = new HashMap< String, List<String >>();
public void addWord(String base, String meaning) {
List<String> allMeanings = dictionary.get(base);
if(allMeanings == null) { // if null, there is no entry mapped to 'base' yet: create a new one
List<String> newMeanings = new ArrayList<String>();
newMeanings.add(meaning);
dictionary.put(base, newMeanings);
} else {
allMeanings.add(meaning);
public List<String> search(String base) {
// your code here
return null;
// ... other methods ...
public String toString() {
StringBuilder strb = new StringBuilder();
for(Map.Entry< String, List<String >> e : dictionary.entrySet()) {
strb.append(e.getKey());
strb.append(" : ");
strb.append(e.getValue());
strb.append('\n');
return strb.toString();
public static void main(String[] args) {
Dictionary dict = new Dictionary();
dict.addWord("Abode", "Home");
dict.addWord("Abode", "House");
dict.addWord("Car", "Automobile");
dict.addWord("Car", "Vehicle");
System.out.println(dict);
}Good luck.
Similar Messages
-
How to create Rules with Flex Field mapping in the bpm worklist
I Have created a flex field label and was able to map to the flex field attributes .
But when i try to create a rules , I don't see the label or the flex attributes in the task payload .
Can someone please help is understanding how to create Rules with Flex Field mapping in the bpm worklist .
Even I am also searching for any scripts which will take the flex fields prompts and can directly create a label in the bpm worklist .
Any pointers or suggestion is highly appreciated .Hi,
SE38 -> Enter program
Select Variants button and display. In the next screen, enter a variant name, (If not existing , press Create to create new one), else click on Change.
Now the selection screen will display with a button "Variant Attributes" at the top.
Click on that button.
In the next screen, go to the selection variable column of the date field. Press F4 or drop down and select 'D' for date maintenance.
In the column "Name of Variable (Input Only Using F4)" press F4 or drop down, select whichever kind of date calculation you want and save the variant.
Now whenever you run the prgrm with this variant, date will be displayed by default.
Regards,
Subramanian -
How to store double variable in hash map
i need to store double variable using hash map, but i cant able to store it
my jsp coding contains
double et=24,j=5;
hm.put("stm",st);
hm.put("etm",et);
Generated servlet error
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\exam\org\apache\jsp\availability_jsp.java:752:
put(java.lang.Object,java.lang.Object) in java.util.Map cannot be applied to (java.lang.String,double)
hm.put("stm",st);
^
how to overcome this problem
thank u in advancedouble etme;
etme = hm.getDouble("etm");
i'm getting this error
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\exam\org\apache\jsp\editdel_jsp.java:85: cannot resolve symbol
symbol : method getDouble (java.lang.String)
location: interface java.util.Map
etme = hm.getDouble("etm");
^
how to solve it
plz help me -
How to create purchase order using VA01 for BAPI?
how to create purchase order using VA01 for BAPI?
Hi Arun,
Please check this link
Example Program for BAPI_PO_CREATE1
Re: BAPI_PO_CREATE1
Questions in BAPI_PO_CREATE1
Problem with BAPI_PO_CREATE1
*& Report BAPI_PO_CREATE *
REPORT bapi_po_create.
Input File Declaration
TYPES: BEGIN OF ty_input_file,
column1 TYPE char50,
column2 TYPE char50,
column3 TYPE char50,
column4 TYPE char50,
column5 TYPE char50,
column6 TYPE char50,
column7 TYPE char50,
column8 TYPE char50,
column9 TYPE char50,
column10 TYPE char50,
column11 TYPE char50,
column12 TYPE char50,
column13 TYPE char50,
column14 TYPE char50,
column15 TYPE char50,
column16 TYPE char50,
column17 TYPE char50,
column18 TYPE char50,
END OF ty_input_file.
DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
wa_input_file TYPE ty_input_file.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',.,..',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
Read presentation server file
PERFORM f1003_upload_file.
IF NOT i_input_file[] IS INITIAL.
PERFORM split_data.
ENDIF.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
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. " f4_presentation_file
*& Form f1003_upload_file
*& Upload File
FORM f1003_upload_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_input_file
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. " f1003_upload_file
*& Form split_data
Collect data for creating Purchase Order
FORM split_data .
DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
i_services TYPE STANDARD TABLE OF bapiesllc ,
i_srvacc TYPE STANDARD TABLE OF bapiesklc,
i_return TYPE STANDARD TABLE OF bapiret2,
wa_header TYPE bapimepoheader,
wa_headerx TYPE bapimepoheaderx,
wa_poitem TYPE bapimepoitem,
wa_poitemx TYPE bapimepoitemx,
wa_poitem_sch TYPE bapimeposchedule,
wa_poitem_schx TYPE bapimeposchedulx,
wa_acct_*** TYPE bapimepoaccount,
wa_acct_assx TYPE bapimepoaccountx,
wa_services TYPE bapiesllc,
wa_srvacc TYPE bapiesklc,
wa_return TYPE bapiret2,
ws_po TYPE bapimepoheader-po_number.
break gbpra8.
wa_services-pckg_no = 10.
wa_services-line_no = 1.
wa_services-outl_no = '0'.
wa_services-outl_ind = c_x.
wa_services-subpckg_no = 20.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 10.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 01.
wa_srvacc-serial_no = 01.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
LOOP AT i_input_file INTO wa_input_file.
IF wa_input_file-column2 EQ 'HD'.
wa_header-doc_type = wa_input_file-column3.
wa_header-creat_date = sy-datum.
wa_header-created_by = sy-uname.
wa_header-vendor = wa_input_file-column4.
PERFORM conversion_output USING wa_header-vendor
CHANGING wa_header-vendor.
wa_header-comp_code = 'DE03'.
wa_header-purch_org = 'DE03'.
wa_header-pur_group = 'DE1'.
wa_header-vper_start = wa_input_file-column9.
wa_header-vper_end = wa_input_file-column10.
wa_headerx-comp_code = c_x.
wa_headerx-doc_type = c_x.
wa_headerx-creat_date = c_x.
wa_headerx-created_by = c_x.
wa_headerx-vendor = c_x.
wa_headerx-purch_org = c_x.
wa_headerx-pur_group = c_x.
wa_headerx-vper_start = c_x.
wa_headerx-vper_end = c_x.
ENDIF.
IF wa_input_file-column2 EQ 'IT'.
wa_poitem-po_item = wa_input_file-column3.
wa_poitem-short_text = wa_input_file-column6.
wa_poitem-plant = wa_input_file-column8.
wa_poitem-quantity = '1'.
wa_poitem-tax_code = 'V0'.
wa_poitem-item_cat = 'D'.
wa_poitem-acctasscat = 'K'.
wa_poitem-matl_group = wa_input_file-column7.
wa_poitem-pckg_no = '10'.
APPEND wa_poitem TO i_poitem .
wa_poitemx-po_item = wa_input_file-column3.
wa_poitemx-po_itemx = c_x.
wa_poitemx-short_text = c_x.
wa_poitemx-plant = c_x.
wa_poitemx-quantity = c_x.
wa_poitemx-tax_code = c_x.
wa_poitemx-item_cat = c_x.
wa_poitemx-acctasscat = c_x.
wa_poitemx-matl_group = c_x.
wa_poitemx-pckg_no = c_x.
APPEND wa_poitemx TO i_poitemx.
wa_poitem_sch-po_item = wa_input_file-column3.
wa_poitem_sch-delivery_date = sy-datum.
APPEND wa_poitem_sch TO i_poitem_sch.
wa_poitem_schx-po_item = wa_input_file-column3.
wa_poitem_schx-po_itemx = c_x.
wa_poitem_schx-delivery_date = c_x.
APPEND wa_poitem_schx TO i_poitem_schx.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 01.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 02.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 01.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 02.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_services-pckg_no = 20.
wa_services-line_no = 2.
wa_services-service = wa_input_file-column9.
wa_services-quantity = '100'.
wa_services-gr_price = '100'.
wa_services-userf1_txt = wa_input_file-column13.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 20.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 02.
wa_srvacc-serial_no = 02.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_header
poheaderx = wa_headerx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
exppurchaseorder = ws_po
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = i_return
poitem = i_poitem
poitemx = i_poitemx
POADDRDELIVERY =
poschedule = i_poitem_sch
poschedulex = i_poitem_schx
poaccount = i_acct_***
POACCOUNTPROFITSEGMENT =
poaccountx = i_acct_assx
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
poservices = i_services
posrvaccessvalues = i_srvacc
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
break gbpra8.
LOOP AT i_return INTO wa_return.
ENDLOOP.
ENDFORM. " split_data
*& Form conversion_output
Conversion exit input
FORM conversion_output USING p_ip
CHANGING p_op.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_ip
IMPORTING
output = p_op.
ENDFORM. " conversion_output
Best regards,
raam -
How to Create Shared Storage using VM-Server 2.1 Red Hat Enterprise Linux 5
Thanks in advance.
Describe in sequence how to create shared storage for a two guest/node Red Hat Linux Enterprise using Oracle 2.1 VM Server on Red Hat Linux Enterprise 5 using command line or appropriate interface.
How to create Shared Storage using Oracle 2.1 VM Server?
How to configure Network for two node cluster (oracle clusterware)?Hi Suresh Kumar,
Oracle Application Server 10g Release 2, Patch Set 3 (10.1.2.3) is required to be fully certified on OEL 5.x or RHEL 5.x.
Oracle Application Server 10g Release 2 10.1.2.0.0 or 10.1.2.0.1 versions are not supported with Oracle Enterprise Linux (OEL) 5.0 or Red Hat Enterprise Linux (RHEL) 5.0. It is recommended that version 10.1.2.0.2 be obtained and installed.
Which implies Oracle AS 10.1.2.x is some what certified on RHEL 5.x
I think it would be better if you get in touch with Oracle Support regarding this .
Sorry , I am not aware of any document on migration from Sun Solaris to RH Linux 5.2 .
Thanks,
Sutirtha -
How to create an array using reflection.
How to create an array using reflection.
I want to achive something like this,Object o;
o = (Object)(new TestClass[10]);but by use of reflection.
To create a single object is simple:Object o;
o = Class.forName("TestClass").newInstance();But how do I create an array of objects, when the class of objects is known only by name? (Can't use Object[] because even though an Object[] array can be filled with "TestClass" elements only, it Cannot be casted to a TestClass[] array)
Anybody knows?":-)
Ragnvald Barth
Software enigneerFound it!
the java.lang.reflect.Array class solves it!
Yes !!! -
How to create a table using Text Layout Framework?
How to create a table using Text Layout Framework? I meen real tables - like in HTML.
Cell as indipendant TLF should work, I have created my table using same approach and works fine for me ... this is where it is
http://apps.live-documents.com/docs/openWebDoc.do?docId=1480607
Regards
Raf -
How to create Handling Unit using Process Order no. & Packing Instruction
Hi experts,
Please guide me how to create Handling Unit using Process Order number & Packing Instruction reference?Noramlly this is done using standard transaction 'COWBPACK'.
ANY FUNCTION MODULE OR BAPI TO DO THIS.
if any solution please explain with proper example..
Thanks In advance
Thanks,
YogeshHi experts,
Please guide me how to create Handling Unit using Process Order number & Packing Instruction reference?Noramlly this is done using standard transaction 'COWBPACK'.
ANY FUNCTION MODULE OR BAPI TO DO THIS.
if any solution please explain with proper example..
Thanks In advance
Thanks,
Yogesh -
How to create web site using STRUTS frame work
Hi,
I know how to create web pages using JSP & Servlets.But now i have to create Matrimonial web site using STRUTS frame work.Plz any one guide for me...
Thank U....Struts is not to be confused with JSF.
Start at their own homepage over there at apache.org.
Good luck. -
How to create CRUD application using bapi in webdynpro java
Hi All,
I have implemented the CRUD application using bapi Now i want to create, retrieve , update and delete the existing table by click on Insert, delete, retrieve ,and update button dynamically. i get null values from database, Please let me know the logic and procedure for how to create CRUD application using bapi Please any one help me..
Thanks in advanceHi,
Hey tell me one thing your BAPI having CURD methods. See you are getting data from BAPI and pull the data in Table in WDJ. So if u can do any action it will comes trough BAPI.
If your BAPI having CURD methods. You can implement CURD methods in WDJAVA also.
@ You said you are getting null values from the database. Please let me know what code you have to wrote for CURD. Please tell me.
Hope this is help full for u
Best Regards
Vijay K -
Reg: How to create shipment by using delivery...
HI all,
How to create shipment by using delivery...
ThanksHi Jamie:
Thank you for your help.
Could you please tell me what is "SQL*Plus session"?
I modified the code into:
Statement Stmt = Conn.createStatement();
Stmt.executeUpdate("CREATE VIEW csclass AS SELECT * FROM CSGRADE10");
The error message is the same:
SQLException: Error during query: Unexpected Exception: java.sql.SQLException message given: Syntax error or access violation: You have an error in your SQL syntax near 'VIEW csclass AS SELECT * FROM CSGRADE10' at line 1
SQLState: S1000
VendorError: 0
I am using MySQL.
Jack -
How to create bookmarks by using J2ME
Hi! Does anyone knows how to create bookmarks by using J2ME?
hey , did u get any help on this?
--vijay
Hi! Does anyone knows how to create bookmarks by
using J2ME? -
How to create SERVICE PR using BAPI_PR_CREATE
Hi everyone,
How to create SERVICE PR using BAPI_PR_CREATE
Regards,
My Code(it doesn't work,I don't know what's wrong.):
*& Report ZWTEST
REPORT zwtest.
DATA: header TYPE bapimereqheader,
headerx TYPE bapimereqheaderx,
item LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,
itemx LIKE TABLE OF bapimereqitemx WITH HEADER LINE,
account LIKE TABLE OF bapimereqaccount WITH HEADER LINE,
accountx LIKE TABLE OF bapimereqaccountx WITH HEADER LINE,
service LIKE TABLE OF bapi_srv_service_line WITH HEADER LINE,
servicex LIKE TABLE OF bapi_srv_service_linex WITH HEADER LINE,
serviceaccount LIKE TABLE OF bapi_srv_acc_data WITH HEADER LINE,
serviceaccountx LIKE TABLE OF bapi_srv_acc_datax WITH HEADER LINE,
preq_no LIKE bapimereqheader-preq_no,
lt_return LIKE TABLE OF bapiret2 WITH HEADER LINE,
wa_return LIKE bapiret2.
header-pr_type = 'NB'."订单类型(采购)
headerx-pr_type = 'X'.
CLEAR: item.
item-preq_item = '00010'.
item-pur_group = '426'."采购组
item-short_text = '服务类PR'."短文本
item-plant = '1051'."工厂
item-matl_group = 'AS07'."物料组
item-item_cat = '9'."项目类别
item-acctasscat = 'K'."科目分配类别
item-pckg_no = '0000000001'."软件包编号
APPEND item.
CLEAR: itemx.
itemx-preq_item = '00010'.
itemx-preq_itemx = 'X'.
itemx-pur_group = 'X'."采购组
itemx-short_text = 'X'."短文本
itemx-plant = 'X'."工厂
itemx-matl_group = 'X'."物料组
itemx-item_cat = 'X'."项目类别
itemx-acctasscat = 'X'."科目分配类别
itemx-pckg_no = 'X'."软件包编号
APPEND itemx.
CLEAR: account.
account-preq_item = '00010'.
account-serial_no = '01'.
*account-quantity = '0.955'.
*account-distr_perc = '95.5'.
account-gl_account = '4205020000'.
account-costcenter = '1042000001'.
*account-co_area = 'CNOC'.
*account-profit_ctr = '9999999999'.
APPEND account.
CLEAR: accountx.
accountx-preq_item = '00010'.
accountx-serial_no = '01'.
accountx-preq_itemx = 'X'.
accountx-serial_nox = 'X'.
*accountx-quantity = 'X'.
*accountx-distr_perc = 'X'.
accountx-gl_account = 'X'.
accountx-costcenter = 'X'.
*accountx-co_area = 'X'.
*accountx-profit_ctr = 'X'.
APPEND accountx.
CLEAR: service.
service-doc_item = '00010'.
service-outline = '0000000001'.
service-srv_line = '0000000010'.
service-short_text = 'service test'.
service-quantity = '10.000'.
service-uom = 'AU'.
service-gross_price = '10.00'.
service-currency = 'CNY'.
*service-matl_group = 'AS07'."物料组
APPEND service.
CLEAR: servicex.
servicex-doc_item = '00010'.
servicex-outline = '0000000001'.
servicex-srv_line = '0000000010'.
servicex-short_text = 'X'.
servicex-quantity = 'X'.
servicex-uom = 'X'.
servicex-gross_price = 'X'.
servicex-currency = 'X'.
*servicex-matl_group = 'X'.
APPEND servicex.
CLEAR: serviceaccount.
serviceaccount-doc_item = '00010'.
serviceaccount-outline = '0000000001'.
serviceaccount-srv_line = '0000000010'.
serviceaccount-serial_no = '01'.
serviceaccount-serial_no_item = '01'.
serviceaccount-percent = '100'.
APPEND serviceaccount.
CLEAR: serviceaccountx.
serviceaccountx-doc_item = '00010'.
serviceaccountx-outline = '0000000001'.
serviceaccountx-srv_line = '0000000010'.
serviceaccountx-serial_no = '01'.
serviceaccountx-serial_no_item = 'X'.
serviceaccountx-percent = 'X'.
APPEND serviceaccountx.
CALL FUNCTION 'BAPI_PR_CREATE'
EXPORTING
prheader = header
prheaderx = headerx
* TESTRUN =
IMPORTING
number = preq_no
* PRHEADEREXP =
TABLES
return = lt_return
pritem = item
pritemx = itemx
* PRITEMEXP =
* PRITEMSOURCE =
praccount = account
* PRACCOUNTPROITSEGMENT =
praccountx = accountx
* PRADDRDELIVERY =
* PRITEMTEXT =
* PRHEADERTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* PRVERSION =
* PRVERSIONX =
* ALLVERSIONS =
* PRCOMPONENTS =
* PRCOMPONENTSX =
* SERVICEOUTLINE =
* SERVICEOUTLINEX =
servicelines = service
servicelinesx = servicex
* SERVICELIMIT =
* SERVICELIMITX =
* SERVICECONTRACTLIMITS =
* SERVICECONTRACTLIMITSX =
serviceaccount = serviceaccount
serviceaccountx = serviceaccountx
* SERVICELONGTEXTS =
* SERIALNUMBER =
* SERIALNUMBERX =
* 处理错误消息:通过判断消息的类型,来判断BAPI是否成功
READ TABLE lt_return INTO wa_return WITH KEY type = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE: / '成功创建采购申请', preq_no.
ENDIF.
LOOP AT lt_return INTO wa_return.
WRITE: / wa_return-message, wa_return-type, wa_return-id, wa_return-number.
ENDLOOP.see note:
1950319 - How to create service PR with BAPI_PR_CREATE.pdf -
How to create field catalog using field-symbols in normal alv report?
hi all,
how to create field catalog using field-symbols in normal alv report? i.e, using function modules...reuse_alv_list_display/grid_display?
regards,
jackHI
LIKE THIS
TYPE-POOLS : slis.
DATA : t_fieldcat TYPE slis_t_fieldcat_alv,
st_fieldcat TYPE slis_fieldcat_alv.
st_fieldcat-fieldname = 'STATUS'.
st_fieldcat-seltext_l = 'STATUS INDICATOR'.
st_fieldcat-outputlen = 17.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'VBELN'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Sales Document No.'.
st_fieldcat-outputlen = 10.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUDAT'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Document Date'.
st_fieldcat-outputlen = 10.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'VBTYP'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Document Type'.
st_fieldcat-outputlen = 4.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUART'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Category'.
st_fieldcat-outputlen = 1.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'AUGRU'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Reason'.
st_fieldcat-outputlen = 3.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'NETWR'.
st_fieldcat-do_sum = 'X'.
st_fieldcat-seltext_l = 'Net Amount'.
st_fieldcat-outputlen = 15.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'WAERK'.
st_fieldcat-do_sum = ' '.
st_fieldcat-seltext_l = 'Unit'.
st_fieldcat-outputlen = 5.
APPEND st_fieldcat TO t_fieldcat.
CLEAR st_fieldcat.
*sortinfo
st_sort-fieldname = 'AUART'.
st_sort-up = 'X'.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'VBTYP'.
st_sort-up = 'X'.
st_sort-subtot = ' '.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'WAERK'.
st_sort-up = 'X'.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
st_sort-fieldname = 'VBELN'.
st_sort-up = ' '.
st_sort-subtot = 'X'.
APPEND st_sort TO t_sort.
CLEAR st_sort.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_eventcat
EXCEPTIONS
list_type_wrong = 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.
IF grid = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = g_program
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = t_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = t_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final
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.
REWARD IF USEFULL -
How to Create add-on using B1DE tools
Hi,
How to create add-on using B1DE tools. if any documentation is there, send me or attached document.
Thanks,
P.Suresh KumarHi,
Here is the link to find out the info about B1DE:
[Content Deleted]
http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/a175fb62-0c01-0010-a8b5-fa58a13b1cf7 [original link is broken]
you may check them. Happy checking.
JimM
Message was edited by: Jason Lax
Maybe you are looking for
-
[Request] vBios - GTX 650Ti Boost ( N650ti TF 2GD5/OC Be )
Help me !! s/n: 602-V287-120B1305043942 My VGA have fan problem. At launch PC, two fan both running and then only one fan(right) is still running, the left fan is not running anymore. I use Afterburner put speed above 80%, both 2 fans run normally bu
-
Toshiba satelite S855-S5188 Freaks out and doesn't respond
Hey, i bought a Toshiba Satelite S855-S5188 from NewEgg.com about two months ago, at first i thought it was nothing, which then Subsequently it ceased to occur for a period of time but now it has been starting back up, this time i have to Shut it dow
-
Web service gen'd wrong?
Using JDev 10.1.3.0.4.3673... The goal of this is to pass an array of objects from a java/oracle web service to a .NET client. I'm posting here because it seems there may be a JDev issue with how a web service is created. OK, I create a stateless ses
-
How can i get ocp full courseware in pdf(not track or syllebus pdfs)
i'm searching for some pdfs that will help me to prepare for ocp. i know the syllebus pdfs but is there any course pdfs??
-
How to move PI objects in IR and ID from DEV to QAS
Hi experts, I am new to PI and with lot of research and help from you all experts I could successfully create a scenario from XML to CSV conversion. I created message interface, interface mapping objects etc.. in "Integration Repository" and