Assignment please!
Could someone please give me some assignment for learning Collections and/or IO?
TIA
UW
Write a program that can list the 25 most common
words found in
a given text file and their number of occurrences.
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.io.IOException;
* Assignment class for counting the occurences of each word in the text
* and display the words in sorted order of most common occurences.
* The program excludes the words present in the exclusion file.
* Suggested by DrLaszloJamf
* Coded by Undead Wraith :-)
public class UndeadAssignment1 {
public static void main(String[] args) {
System.out.println("Start assignment... :-)");
// File containing words to be excluded.
String excludeFile = "exclude.list";
// File containing the text
String textFile = "foo.in";
try {
Set excludeSet = loadExclusionSet(excludeFile);
Map countMap = readFileCount(textFile, excludeSet);
List resultList = sortMapResults(countMap);
printResults(resultList);
} catch (UndeadException ue) {
System.out.println("Back to the crypt... :-(");
ue.printStackTrace();
System.out.println("End assignment...");
// Reads the file and counts the words in it, omitting the excluded word set.
public static Map readFileCount(String textFile, Set excludeSet) throws UndeadException {
Map hm = new HashMap();
BufferedReader br = null;
String input = null;
String result = null;
StringTokenizer strTok = null;
int integer = 0; // Temporary initialization.
try {
br = new BufferedReader(new FileReader(textFile));
while((input = br.readLine()) != null) {
strTok = new StringTokenizer(input);
while(strTok.hasMoreTokens()) {
result = strTok.nextToken().replaceAll("[,.;:?!@#$%^&*()\\[\\]{}<>\\/-]", "").toLowerCase();
if(!result.trim().equals("") && !excludeSet.contains(result)) {
if(hm.containsKey(result)) {
integer = ((Integer)hm.get(result)).intValue();
integer++;
hm.put(result, new Integer(integer));
} else {
hm.put(result, new Integer("1"));
} catch (IOException ioe) {
throw new UndeadException(ioe.getMessage());
} catch(Exception e) {
throw new UndeadException(e.getMessage());
return hm;
// Reads the excluded word set.
public static Set loadExclusionSet(String excludeFile) throws UndeadException {
Set exclusionSet = new HashSet();
BufferedReader br = null;
String input = null;
try {
br = new BufferedReader(new FileReader(excludeFile));
while((input = br.readLine()) != null) {
exclusionSet.add(input.trim());
} catch (IOException ioe) {
throw new UndeadException(ioe.getMessage());
} catch(Exception e) {
throw new UndeadException(e.getMessage());
return exclusionSet;
// Prints the result.
// This would be modified to output to an Excel workbook.
public static void printResults(List list) {
String str = null;
Iterator iterator = list.iterator();
System.out.println("Results: ");
while(iterator.hasNext()) {
str = (String)iterator.next();
System.out.println(str);
// Sort the results in the Map and returns a List in requisite format.
public static List sortMapResults(Map resultMap) throws UndeadException {
Set printSet = resultMap.entrySet();
List resultList = new ArrayList();
Iterator iterator = printSet.iterator();
String tempString = null;
try {
while(iterator.hasNext()) {
resultList.add(iterator.next().toString());
Collections.sort(resultList, new MyComparator());
} catch (Exception e) {
throw new UndeadException(e.getMessage());
return resultList;
* UndeadException class.
* My own damn exception
* to play around with exception handling.
class UndeadException extends Exception {
UndeadException(String message) {
super(message);
* MyComparator class.
* Compares two Strings - intended to sort
* by name ascending and count descending.
class MyComparator implements Comparator {
public int compare(Object o1, Object o2) {
String s1 = o1.toString();
String s2 = o2.toString();
int i1 = Integer.parseInt(s1.toString().substring(s1.indexOf("=") +1));
int i2 = Integer.parseInt(s2.toString().substring(s2.indexOf("=") +1));
if(i1 == i2) {
return s1.compareTo(s2);
} else {
return i2 - i1;
}Here's my code after a considerable effort to read the API all by myself. I hope someone finds some faults with this.
I'll try to add the Excel workbook thing now :)
Thanks all!
UW
Similar Messages
-
Hi,
Currently I'm facing an error "In case of account assignment, please enter acc. assignment data for item" when create a Purchase Order using BAPI_PO_CREATE1. The condition of the data that need to pump into the system is that this PO is an open item PO where does not require a metarial code for input, but it will pump in Short Text and Material Group. Other than that, the account assignment category is "K" and the item category is "9".
Below is the coding that I have implemented.
IF wa_temp_upr1-waers IS NOT INITIAL.
MOVE wa_temp_upr1-waers TO wa_header-currency.
wa_headerx-currency = abap_true.
ENDIF.
MOVE: wa_temp_upr1-lifnr TO wa_header-vendor,
wa_temp_upr1-unsez TO wa_header-collect_no,
wa_temp_upr1-bukrs TO wa_header-comp_code,
sy-datum TO wa_header-doc_date,
sy-langu TO wa_header-langu,
'KTN1' TO wa_header-purch_org,
wa_temp_upr1-bkgrp TO wa_header-pur_group,
wa_temp_upr1-zterm TO wa_header-pmnttrms.
wa_headerx-collect_no = abap_true.
wa_headerx-po_number = abap_true.
wa_headerx-comp_code = abap_true.
wa_headerx-vendor = abap_true.
wa_headerx-doc_date = abap_true.
wa_headerx-langu = abap_true.
wa_headerx-purch_org = abap_true.
wa_headerx-pur_group = abap_true.
wa_headerx-pmnttrms = abap_true.
IF wa_temp_upr1-meins IS NOT INITIAL.
MOVE wa_temp_upr1-meins TO zunit_e.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = zunit_e
LANGUAGE = 'E'
IMPORTING
OUTPUT = zunit_e.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ELSE.
MOVE zunit_e TO wa_temp_upr1-meins.
ENDIF.
MODIFY it_upr1 FROM wa_temp_upr1.
ENDIF.
ADD 10 TO line_item.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
NR_RANGE_NR = '01'
OBJECT = 'SERVICE'
IMPORTING
NUMBER = pckg_no.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = wa_temp_upr1-matnr
IMPORTING
OUTPUT = wa_po_item-material.
MOVE: line_item TO wa_po_item-po_item,
wa_temp_upr1-ewerks TO wa_po_item-plant,
wa_temp_upr1-lgort TO wa_po_item-stge_loc,
wa_temp_upr1-matnr TO wa_po_item-material,
wa_temp_upr1-menge TO wa_po_item-quantity,
wa_temp_upr1-peinh TO wa_po_item-price_unit,
wa_temp_upr1-netpr TO wa_po_item-net_price,
wa_temp_upr1-meins TO wa_po_item-po_unit,
wa_temp_upr1-afnam TO wa_po_item-preq_name,
wa_temp_upr1-eeind TO wa_po_item-price_date,
' ' TO wa_po_item-gr_ind,
'X' TO wa_po_item-ir_ind,
'X' TO wa_po_item-prnt_price,
' ' TO wa_po_item-distrib.
wa_po_item-acctasscat = 'K'.
MOVE pckg_no TO wa_po_item-pckg_no.
wa_po_itemx-pckg_no = abap_true.
IF wa_temp_upr1-bismt IS INITIAL.
MOVE: wa_temp_upr1-short_text TO wa_po_item-short_text,
wa_temp_upr1-matl_group TO wa_po_item-matl_group,
'9' TO wa_po_item-item_cat.
wa_po_itemx-short_text = abap_true.
wa_po_itemx-matl_group = abap_true.
wa_po_itemx-item_cat = abap_true.
wa_potext-po_item = wa_po_item-po_item.
wa_potext-text_id = 'F01'.
APPEND wa_potext TO it_potext.
ENDIF.
MOVE wa_po_item-po_item TO wa_po_itemx-po_item.
wa_po_itemx-plant = abap_true.
wa_po_itemx-po_itemx = abap_true.
wa_po_itemx-stge_loc = abap_true.
IF wa_po_item-material IS NOT INITIAL.
wa_po_itemx-material = abap_true.
ENDIF.
wa_po_itemx-quantity = abap_true.
wa_po_itemx-price_unit = abap_true.
wa_po_itemx-net_price = abap_true.
wa_po_itemx-po_unit = abap_true.
wa_po_itemx-preq_name = abap_true.
wa_po_itemx-price_date = abap_true.
wa_po_itemx-acctasscat = abap_true.
wa_po_itemx-gr_ind = abap_true.
wa_po_itemx-distrib = abap_true.
wa_po_itemx-part_inv = abap_true.
APPEND wa_po_item TO it_item.
APPEND wa_po_itemx TO it_itemx.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = wa_temp_upr1-kostl
IMPORTING
OUTPUT = wa_temp_upr1-kostl.
wa_account-costcenter = wa_temp_upr1-kostl.
ADD 1 TO l_acc.
ADD 10 TO v_po_item.
MOVE v_po_item TO wa_account-po_item.
MOVE '01' TO wa_account-serial_no.
APPEND wa_account TO it_account.
wa_accountx-costcenter = abap_true.
MOVE v_po_item TO wa_accountx-po_item.
MOVE '01' TO wa_accountx-serial_no.
wa_accountx-SERIAL_NOX = abap_true.
wa_accountx-po_itemx = abap_true.
APPEND wa_accountx TO it_accountx.
*********** services
wa_services-pckg_no = pckg_no.
wa_services-line_no = '0000000001'.
wa_services-outl_ind = 'X'.
wa_services-subpckg_no = pckg_no + 1.
wa_services-quantity = wa_temp_upr1-menge.
wa_services-base_uom = wa_temp_upr1-meins.
wa_services-price_unit = wa_temp_upr1-peinh.
wa_services-gr_price = wa_temp_upr1-netpr.
IF wa_temp_upr1-short_text IS NOT INITIAL.
wa_services-short_text = wa_temp_upr1-short_text.
ENDIF.
APPEND wa_services TO it_services.
CLEAR: wa_services,
val_lin.
wa_services-pckg_no = pckg_no + 1.
wa_services-line_no = '0000000002'.
wa_services-quantity = wa_temp_upr1-menge.
wa_services-base_uom = wa_temp_upr1-meins.
wa_services-price_unit = wa_temp_upr1-peinh.
wa_services-gr_price = wa_temp_upr1-netpr.
IF wa_temp_upr1-short_text IS NOT INITIAL.
wa_services-short_text = 'SERVICE 1'.
ENDIF.
IF NOT wa_temp_upr1-matl_group IS INITIAL.
wa_services-matl_group = wa_temp_upr1-matl_group.
ENDIF.
APPEND wa_services TO it_services.
************* service account assignment
wa_services_acc-pckg_no = pckg_no + 1.
wa_services_acc-line_no = '0000000002'.
wa_services_acc-serno_line = '01'.
wa_services_acc-quantity = wa_temp_upr1-menge.
wa_services_acc-serial_no = '01'.
wa_services_acc-net_value = wa_temp_upr1-netpr.
APPEND wa_services_acc TO it_services_acc.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = wa_header
POHEADERX = wa_headerx
TESTRUN = pa_test
NO_PRICE_FROM_PO = 'X'
IMPORTING
EXPPURCHASEORDER = va_ebeln
EXPHEADER = wa_expheader
TABLES
RETURN = it_return
POITEM = it_item
POITEMX = it_itemx
POACCOUNT = it_account
POACCOUNTX = it_accountx
POSERVICES = it_services
POSRVACCESSVALUES = it_services_acc
POTEXTITEM = it_potext.
I have done some search regarding this error and try to implemented it, but still does not working.
example website that i found for this error is:
David Klein's Corner: SAP Purchase Order Creation Error via BAPI - "In case of account assignment, please enter acc…
PO Upload through BAPI_PO_CREATE1 - Problem in Service Item
Currently my system is using: SAP_APPL SAPKH60604
I am really stuck on this error. Hope you all can help me on this matter.
Thanks.Hi,
Filling the service line have the problem,
while filling the services we must follow correct order,
Here You entering the new services, first manually create purchase order after that observe the table
'ESLL' and use the FM;-' MS_FETCH_SPEC_FOR_LIST' how the services are inserting after that you also follow the same order.
if service entries are created before the creation of the PO.
then follow as bellow....
SELECT * FROM esll INTO TABLE lt_esll WHERE packno = wa_tmp_spec-packno.
IF sy-subrc = '0'.
LOOP AT lt_esll.
CLEAR : lt_poservices.
lt_poservices-pckg_no = lt_esll-packno .
lt_poservices-line_no = lt_esll-introw .
lt_poservices-ext_line = lt_esll-extrow .
lt_poservices-outl_level = lt_esll-rang .
lt_poservices-outl_no = lt_esll-extgroup .
lt_poservices-outl_ind = lt_esll-del .
lt_poservices-subpckg_no = lt_esll-sub_packno .
lt_poservices-service = lt_esll-srvpos .
lt_poservices-edition = lt_esll-ausgb .
lt_poservices-ssc_item = lt_esll-stlvpos .
lt_poservices-ext_serv = lt_esll-extsrvno.
lt_poservices-quantity = lt_esll-menge .
lt_poservices-base_uom = lt_esll-meins .
lt_poservices-ovf_tol = lt_esll-uebto .
lt_poservices-ovf_unlim = lt_esll-uebtk .
lt_poservices-gr_price = lt_esll-tbtwr .
lt_poservices-from_line = lt_esll-frompos .
lt_poservices-to_line = lt_esll-knt_introw.
lt_poservices-short_text = lt_esll-ktext1 .
lt_poservices-distrib = lt_esll-vrtkz .
lt_poservices-pers_no = lt_esll-pernr .
lt_poservices-wagetype = lt_esll-lgart .
lt_poservices-con_pckg = lt_esll-knt_packno.
lt_poservices-con_line = lt_esll-knt_introw .
lt_poservices-matl_group = lt_esll-matkl .
lt_poservices-taxjurcode = lt_esll-txjcd.
lt_poservices-tax_code = lt_esll-mwskz .
lt_poservices-date = lt_esll-sdate .
APPEND lt_poservices TO lt_poservices[].
CLEAR lt_esll.
ENDLOOP.
ENDIF.
CALL FUNCTION 'MS_FETCH_SPEC_FOR_LIST'
EXPORTING
spec_packno = wa_tmp_spec-packno
* ONLINE_DATA = ' '
* IMPORTING
* LIMIT =
TABLES
servicetab = lt_ml_esll1
* LIMITTAB =
EXCEPTIONS
no_specification_exist = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT lt_ml_esll1 INTO DATA(ls_ml_esll1).
CLEAR : lt_poservices.
lt_poservices-pckg_no = ls_ml_esll1-packno .
lt_poservices-line_no = ls_ml_esll1-introw .
lt_poservices-ext_line = ls_ml_esll1-extrow .
lt_poservices-outl_level = ls_ml_esll1-rang .
lt_poservices-outl_no = ls_ml_esll1-extgroup .
lt_poservices-outl_ind = ls_ml_esll1-del .
lt_poservices-subpckg_no = ls_ml_esll1-sub_packno .
lt_poservices-service = ls_ml_esll1-srvpos .
lt_poservices-edition = ls_ml_esll1-ausgb .
lt_poservices-ssc_item = ls_ml_esll1-stlvpos .
lt_poservices-ext_serv = ls_ml_esll1-extsrvno.
lt_poservices-quantity = ls_ml_esll1-menge .
lt_poservices-base_uom = ls_ml_esll1-meins .
lt_poservices-ovf_tol = ls_ml_esll1-uebto .
lt_poservices-ovf_unlim = ls_ml_esll1-uebtk .
lt_poservices-gr_price = ls_ml_esll1-tbtwr .
lt_poservices-from_line = ls_ml_esll1-frompos .
lt_poservices-to_line = ls_ml_esll1-knt_introw.
lt_poservices-short_text = ls_ml_esll1-ktext1 .
lt_poservices-distrib = ls_ml_esll1-vrtkz .
lt_poservices-pers_no = ls_ml_esll1-pernr .
lt_poservices-wagetype = ls_ml_esll1-lgart .
lt_poservices-con_pckg = ls_ml_esll1-knt_packno.
lt_poservices-con_line = ls_ml_esll1-knt_introw .
lt_poservices-matl_group = ls_ml_esll1-matkl .
lt_poservices-taxjurcode = ls_ml_esll1-txjcd.
lt_poservices-tax_code = ls_ml_esll1-mwskz .
lt_poservices-date = ls_ml_esll1-sdate .
APPEND lt_poservices TO lt_poservices[].
CLEAR ls_ml_esll1.
ENDLOOP.
CLEAR : lt_poservices.
*& Filling the po service values internal table from service internal table
LOOP AT lt_poservices[] INTO lt_poservices WHERE gr_price GT 0.
READ TABLE lt_ml_esll1 INTO wa_msll WITH KEY packno = lt_poservices-pckg_no
introw = lt_poservices-line_no
extrow = lt_poservices-ext_line..
IF sy-subrc EQ 0.
CLEAR lt_posvalues.
lt_posvalues-pckg_no = wa_msll-packno.
lt_posvalues-line_no = wa_msll-introw.
lt_posvalues-quantity = wa_msll-menge.
* lt_posvalues-net_value = wa_msll-netwr.
lt_posvalues-serno_line = '01'.
lt_posvalues-serial_no = '01'.
* lt_posvalues-percentage = '100'.
APPEND lt_posvalues TO lt_posvalues[].
CLEAR : wa_msll.
ENDIF.
ENDLOOP.
note:- if it is correct give points -
RE: In case of account assignment, please enter acc. assignment data for it
Dear All,
I am getting the Error : 'In case of account assignment, please enter acc. assignment data for item'. when I try to create a service PO(I mean when the 'Item Cat' = 9 (D) and Account assignment category as K) .
I am populating POACCOUNT and POACCOUNTX structures of BAPI Correctly even the POSERVICES structure.
I tried even by creating through me21n, there it is getting created correctly. The order in which I am trying to enter in ME21N is First I am providing Org Data,
Next Item data with Acct assn cat as 'K' Item Category as 'D' short text, PO quantity, Order Unit, Net price, Material group, Plant,
Requisitioner.
Next it is prompting for Services data : short text, quantity, Unit, Gross price.
Then it is prompting for Account assignment of service in line 10, there I am giving GL account, Cost center.
It is creating the PO successfully.
But when I try using BAPI (BAPI_PO_CREARE1) it is giving the error 'In case of account assignment, please enter acc. assignment data for item'.
Please do the needful.
Thanks & Warm Regards,
Jayarama Krishna.Dear All,
Who ever facing the above problem can use the below code, problem is solved.
When we create Purchase Order using "BAPI_PO_CREATE1", it works for all cases but we can have problems when we create Service Items in PO. Either we get an error u201CPlease maintain services or limitsu201D or u201CIn case of Account assignment, please enter acc. assignment data for itemu201D.
Service PO occurs when we enter item category u2018Du2019 (Service) and Account category u2018Ku2019 (Cost Center).
When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
a) POITEM
b) POITEMX
c) POACCOUNT
d) POACCOUNTX
e) POSERVICES
f) POSRVACCESSVALUES
For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
Set PCKG_NO flag in POITEMX table as u2018Xu2019.
Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
Set POACCOUNT-SERIAL_NO to u201801u2019.
Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
WA_POSERVICES-PCKG_NO = u20180000000001u2019.
WA_POSERVICES-LINE_NO = u20180000000001u2019.
WA_POSERVICES-OUTL_IND = u2018Xu2019.
WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
WA_POSERVICES-QUANTITY = u2018100.000u2019.
WA_POSERVICES-BASE_UOM = u2018EAu2019.
WA_POSERVICES-PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
WA_POSERVICES- PCKG_NO = u20180000000003u2019.
WA_POSERVICES- LINE_NO = u20180000000002u2019.
WA_POSERVICES-QUANTITY = u201810.000u2019.
WA_POSERVICES- BASE_UOM = u2018EAu2019.
WA_POSERVICES--PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
WA_POSERVICES-MATL_GROUP = u20180012u2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
This logic will work definitely and PO Service Items will be created. -
Please, I need your help...
I am trying to create the PO´s since last week, but is imposible. I try to search posts about this same case but, nothing good to me.
Well, I am creating a Service PO using an agreement and buying to cost center.
When I execute the BAPI generate this messege:
E 06 436 In case of account assignment, please enter acc. assignment data for item .
I put the agreement and item in POITEM and checked in POITEMX. The system bring to me all fields of agreement, but don´t bring the account. In PO ITEM bring the ACCTASSCAT = K.
What I must to do to bring the Account Itens that are inside of my agreement.
Please, help me. I am with problems because I can´t do it.
Thanks a lot ,
Victoria.Hi,
When we create Purchase Order using "BAPI_PO_CREATE1", it works for all cases but we can have problems when we create Service Items in PO. Either we get an error u201CPlease maintain services or limitsu201D or u201CIn case of Account assignment, please enter acc. assignment data for itemu201D.
Service PO occurs when we enter item category u2018Du2019 (Service) and Account category u2018Ku2019 (Cost Center).
When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
a) POITEM
b) POITEMX
c) POACCOUNT
d) POACCOUNTX
e) POSERVICES
f) POSRVACCESSVALUES
For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
Set PCKG_NO flag in POITEMX table as u2018Xu2019.
Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
Set POACCOUNT-SERIAL_NO to u201801u2019.
Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
WA_POSERVICES-PCKG_NO = u20180000000001u2019.
WA_POSERVICES-LINE_NO = u20180000000001u2019.
WA_POSERVICES-OUTL_IND = u2018Xu2019.
WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
WA_POSERVICES-QUANTITY = u2018100.000u2019.
WA_POSERVICES-BASE_UOM = u2018EAu2019.
WA_POSERVICES-PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
WA_POSERVICES- PCKG_NO = u20180000000003u2019.
WA_POSERVICES- LINE_NO = u20180000000002u2019.
WA_POSERVICES-QUANTITY = u201810.000u2019.
WA_POSERVICES- BASE_UOM = u2018EAu2019.
WA_POSERVICES--PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
WA_POSERVICES-MATL_GROUP = u20180012u2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
This logic will work definitely and PO Service Items will be created. -
Hello!
While using bapi_po_create1 and making it account assignment in services case
i get an error
E 06 436 In case of account assignment, please enter acc. assignment data for item
Thanks!Hello,
When we create Purchase Order using "BAPI_PO_CREATE1", it works for all cases but we can have problems when we create Service Items in PO. Either we get an error u201CPlease maintain services or limitsu201D or u201CIn case of Account assignment, please enter acc. assignment data for itemu201D.
Service PO occurs when we enter item category u2018Du2019 (Service) and Account category u2018Ku2019 (Cost Center).
When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
a) POITEM
b) POITEMX
c) POACCOUNT
d) POACCOUNTX
e) POSERVICES
f) POSRVACCESSVALUES
For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
Set PCKG_NO flag in POITEMX table as u2018Xu2019.
Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
Set POACCOUNT-SERIAL_NO to u201801u2019.
Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
WA_POSERVICES-PCKG_NO = u20180000000001u2019.
WA_POSERVICES-LINE_NO = u20180000000001u2019.
WA_POSERVICES-OUTL_IND = u2018Xu2019.
WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
WA_POSERVICES-QUANTITY = u2018100.000u2019.
WA_POSERVICES-BASE_UOM = u2018EAu2019.
WA_POSERVICES-PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
WA_POSERVICES- PCKG_NO = u20180000000003u2019.
WA_POSERVICES- LINE_NO = u20180000000002u2019.
WA_POSERVICES-QUANTITY = u201810.000u2019.
WA_POSERVICES- BASE_UOM = u2018EAu2019.
WA_POSERVICES--PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
WA_POSERVICES-MATL_GROUP = u20180012u2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
This logic will work definitely and PO Service Items will be created.
Thanks,
Jayarama Krishna -
Help with product category assignment please
Hi experts,
I need to do a modificacion in my R3 downloaded products to CRM. Because a
product catalog fulfitment, I need to modify the assigned product hierarchy
in CRM but I don't know where can I do it this mapping between an R3 product
hierarchy and CRM product hierarchy.
I explain, if product A belongs in R3 to product category A, I need to modify
this assignment in CRM, for exmaple, product A in CRM will belong to product category
B.
Modifications/creations on product master are only downloaded to CRM, never upload
from CRM to R3.
Any help in this issue please? Is possible to get a behaviour like this?
Thanks to all.
JavierHi Javier,
You can always do a RFC data upload of the changed product from CRM to R/3. I guess you do know how to trigger a OLTP data transfer in product master maintenance transaction COMMPR01.
Thanks,
Sudipta. -
For this part of my assignment, I have to take the code (shown below) which displays a single orange triangle, and modify it so that the applet displays 3 triangles in 3 separate locations. I have been playing with the code for hours and have gotten nowhere. If anyone can help me with this it would be of inestimable value to me. Thank you in advance.
Here is the original code for the one triangle.
* Part 0
* CSC104H Fall 2007
* a triangle
import java.awt.*;
import java.applet.*;
public class Part0 extends Applet {
private Location location;
private Color color;
private Triangle triangle;
private Location corner1;
private Location corner2;
private Location corner3;
/* Initialize variables for the triangles */
public void init() {
location = new Location(20, 10);
color = new Color(250, 125, 0);
corner1 = new Location(0, 300);
corner2 = new Location(50, 275);
corner3 = new Location(40, 325);
triangle = new Triangle(corner1, corner2,
corner3, location, color);
public void start() {
public void stop() {
public void destroy() {
/* Paint the triangle */
public void paint(Graphics g) {
triangle.paint(g);
}/* Initialize variables for the triangles */
public void init() {
location = new Location(20, 10);
color = new Color(250, 125, 0);
corner1 = new Location(0, 300);
corner2 = new Location(50, 275);
corner3 = new Location(40, 325);
triangle = new Triangle(corner1, corner2,
corner3, location, color);
I know how you feel, it helps if you start the course with some programming experience. Try to go through the Java Tutorials which can be found from the main page and it is very helpful to a point (I always get stuck even using them). You will quickly come across some things teaching you how to create objects - which is what your triangle is.
Within this code of your application you are declaring the X, Y pos of each corner on the triangle and then creating a new triangle object (bold) using these parameters. When you paint the triangle you are displaying it on your applet. As mentioned above, try creating a method to iterate through the object creation for you (creating an array of triangles) and then paint this array, or each triangle seperately.
Edited by: Drew___ on Nov 6, 2007 2:52 AM
Declaring an array of triangles - Triangle[] theTriangles; //theTriangles is the array
you will need more vairables - int maxTriangles, numTriangles;
iterating through - for (int j = 0; numTriangles < theTriangles[maxTriangles]; ++j)
//Create new triangle object = theTriangles[j] //j represents element position of triangle in the array
} -
JSP assignment, please advise
Hi, Gurus. i got a group assignment,http://www.cs.newcastle.edu.au/~seng2050/assigns/assign3.html The lecture said one of the best assignments will finally be adapted by a local company. i really want to compete for this opportunity. So, i wish someone could give me some suggestions and tips for a good design before i get into the pratical coding stage.Thanx so much for taking your time reading the assignment spec. Any suggestions would be highly appreciated.
tips and guidelines ? I'm sure there are plenty of design patterns availlable for this type of assignment. You might want to check out http://www.theserverside.com for those...
If I were you, I'd give everyone in the group a specific task. So one would be designing the HTML pages (and research the technology used for it, for example struts), another would be assigned the database related stuff (this person would have to study the JDBC part), etc. Have one person in charge of the overall application, preferably NOT the person doing the database stuff, because he'll just complicate everything to avoid having to do to much work himself. Make sure you create interfaces first, and (more important) make sure everybody understands how the interfaces work (so don't just decide on method names, but specify pre- and post conditions).
hope it helps, feel free to ask (more specific than 'I need help') questions... -
Help me in assignment please.
The Implementation of a Client/Server Framework with Database Access
I need to create three files(NO GUI required using command line):
*1.QueryClient.java:* This program takes a student’s number as an argument. This program
will send the student’s number as a request to the server and wait for the server’s reply.
This program will display the student’s contact details once it receives from the server.
*2. StudentServer.java:* This program is continuously waiting for requests from clients. Once
the server receives a request, it will create a thread to process the request and send a
response to the client. It means that the server follows the ‘thread-per-request’ multithreading model. The server maintains students’ contact details in a table in a database. Each time the server receives a request, it will query the table for the corresponding
student’s contact details.
*3. Contact.java:* the Java implementation of request processing thread.
i have to use Microsoft Access as the backend database, therefore
need to use JDBC-ODBC bridge driver to query the database.
i need to use UDP as the communication protocol to program the client and the
server interaction.
The following screenshots show the outputs of an implementation of the QueryClient and the
StudentServer and the Contact table in the Microsoft Access database:Welcome to the forum!
>
I need to create three files(NO GUI required using command line):
i need to use UDP as the communication protocol to program the client and the
server interaction.
>
Excellent! Then that is what you should do. Thank you for sharing.
The following screenshots show how I implemented this when I took the class. Hope you find them useful. -
How to solve the error 'please enter account assignment ' in BAPI_PO_CREATE.
Hi gurus,
While creating shopping cart with an item from services type i am getting error please enter account assignment.Please suggest me how to solve this error
thanks®ards,
Suneel Kumar.Hi Suneel,
Are you getting while transferring the Shopping cart into ECC? Or you are getting while creating Shopping cart in SRM?
Thank you
Ritesh -
BAPI_PO_CHANGE for account assignment tab
Hi sdn,
I am trying to chnage the Account Assgnment tab details with the BAPI BAPI_PO_CHANGE and getting below error message.
E MEPO 000 Purchase order still contains faulty items
I 06 684 Releases already effected are liable to be reset
E 06 436 In case of account assignment, please enter acc. assignment data for item
I am trying to the chnage the line item details for Acount assignment type - Cost center. Item catagory - Limit.
Th evalue i am changing - Gl account and Cost center.
Below is the sample code.
APPEND wa_poitem TO it_poitem.
wa_poitemx-po_item = wa_poitem-po_item.
wa_poitemx-po_itemx = c_x.
APPEND wa_poitemx TO it_poitemx.
wa_poaccount-costcenter = wa_po_tmp_c-kostl.
wa_poaccountx-costcenter = c_x.
wa_poaccount-gl_account = wa_po_tmp_c-sakto.
wa_poaccountx-gl_account = c_x.
wa_poaccount-gr_rcpt = wa_po_tmp_c-wempf.
wa_poaccountx-gr_rcpt = c_x.
wa_poaccountx-po_item = wa_po_tmp_c-ebelp.
wa_poaccountx-serial_no = wa_poaccount-serial_no.
wa_poaccountx-po_itemx = c_x.
wa_poaccountx-serial_nox = c_x.
APPEND wa_poaccount TO it_poaccount.
APPEND wa_poaccountx TO it_poaccountx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wa_po_c-ebeln
testrun = v_testrun
no_messaging = c_x
no_message_req = c_x
IMPORTING
expheader = wa_expheader
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx
poaccount = it_poaccount
poaccountx = it_poaccountxHi I had fixed this problem by creating Enhancement point in the Method .
IF_PURCHASE_ORDER_MM~SET_DATA
at the end of the method.
if sy-tcode = 'ZPO_ACCT_CHANGE'.
free my_recheck_queue[].
refresh my_recheck_queue[].
endif.
Edited by: Naresh Nelapatla on May 13, 2011 5:17 PM -
Using BAPI_PO_CREATE1 : Linking service, and account assignment
Hello,
I have trouble when using BAPI_PO_CREATE1. When creating PO using BAPI_PO_CREATE1, I need to input service for each po item and the service itself need to have account assignment. I simplify the code below.
**PO item
t_poitem-po_item = '10'. "for item 10
t_poitem-PCKG_NO = '20'. "link with service
t_poitemx-po_item = 'X'.
t_poitemx-PCKG_NO = 'X'.
**Account Assignment
t_poaccount-po_item = '10'. "link with PO Item
t_poaccount-SERIAL_NO = '01'.
t_poaccount-DISTR_PERC = 1.
t_poaccountx-po_item = '10'.
t_poaccountx-SERIAL_NO = '01'.
t_poaccountx-po_itemx = 'X'.
t_poaccountx-SERIAL_NOx = 'X'.
t_poaccountx-DISTR_PERC = 'X'.
**PO Services
**1st row
t_poservices-PCKG_NO = '20'.
t_poservices-LINE_NO = '0000000001'.
t_poservices-SUBPCKG_NO = '21'.
APPEND t_poservices.
clear t_poservices.
**2nd row
t_poservices-PCKG_NO = '21'.
t_poservices-LINE_NO = '0000000002'.
t_poservices-EXT_LINE = '0000000010'.
**fill account assignment for services
t_POSRVACCESSVALUES-pckg_no = '21'.
t_POSRVACCESSVALUES-LINE_NO = '0000000002'.
T_POSRVACCESSVALUES-SERNO_LINE = '01'.
t_POSRVACCESSVALUES-SERIAL_NO = '01'. "acct. assign. link
t_POSRVACCESSVALUES-PERCENTAGE = '100'.
Every time i execute BAPI_PO_CREATE1 using entry similar like above, i always found error message in t_return like this:
No account assignment exists for service line 0000000010
I feel sure that i have fill every field needed to link services and account assignment which is using serial_no, but somehow it does not link correctly. Can anyone advise me if there is some thing missing or incorrect with my ABAP code above? Thank you in advance for your help. For sure, first helpful answer will receive my rewards point.
Regards,
AbrahamThank you for the code. Actually i have fill the required field as you told but i did not put it in my code here to focus the problem on service and account assignment. After checking out your code, i found that the different between your code and mine is in services table.
<u><b>your code :</b></u>
<b>POSERVICES:structure</b>
PCKG_NO : 0000000001
LINE_NO :0000000001
SUBPCKG_NO : 0000000002
SERVICE :3000000000017
QUANTITY :5
BASE_UOM :AU
GR_PRICE :20000
<b>POSRVACCESSVALUES: structure name</b>
PCKG_NO :0000000002
LINE_NO :0000000002
<u><b>my code are:</b></u>
<b>POSERVICES:structure</b>
PCKG_NO : 0000000001
LINE_NO :0000000001
SUBPCKG_NO : 0000000002
PCKG_NO : 0000000002
LINE_NO :0000000002
SERVICE :3000000000017
QUANTITY :5
BASE_UOM :AU
GR_PRICE :20000
<b>POSRVACCESSVALUES: structure name</b>
PCKG_NO :0000000002
LINE_NO :0000000002
SERIAL_NO :0000000001
The other difference are in account assignment table, you didn't fill SERIAL_NO field.
my code will be like below:
<b>POACCOUNT: structure name</b>
PO_ITEM :10
SERIAL_NO : 0000000001
If using your version, the error message will be:
<i>In case of account assignment, please enter acc. assignment data for item</i>
If using my version, the error message will be:
<i>No account assignment exists for service line 0000000010</i>
Please advise what was wrong with my code. Thank you.
Regards,
Abraham -
BAPI_PO_CREATE1 - E 06 436 In case of account assignment
Please, I need your help...
I am trying to create the PO´s since last week, but is imposible. I try to search posts about this same case but, nothing good to me.
Well, I am creating a Service PO using an agreement and buying to cost center.
When I execute the BAPI generate this messege:
E 06 436 In case of account assignment, please enter acc. assignment data for item .
I put the agreement and item in POITEM and checked in POITEMX. The system bring to me all fields of agreement, but don´t bring the account. In PO ITEM bring the ACCTASSCAT = K.
What I must to do to bring the Account Itens that are inside of my agreement?
Please, help me. I am with problems because I can´t do it.
Thanks a lot ,
Victoria.Hi,
When we create Purchase Order using "BAPI_PO_CREATE1", it works for all cases but we can have problems when we create Service Items in PO. Either we get an error u201CPlease maintain services or limitsu201D or u201CIn case of Account assignment, please enter acc. assignment data for itemu201D.
Service PO occurs when we enter item category u2018Du2019 (Service) and Account category u2018Ku2019 (Cost Center).
When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
a) POITEM
b) POITEMX
c) POACCOUNT
d) POACCOUNTX
e) POSERVICES
f) POSRVACCESSVALUES
For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
Set PCKG_NO flag in POITEMX table as u2018Xu2019.
Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
Set POACCOUNT-SERIAL_NO to u201801u2019.
Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
WA_POSERVICES-PCKG_NO = u20180000000001u2019.
WA_POSERVICES-LINE_NO = u20180000000001u2019.
WA_POSERVICES-OUTL_IND = u2018Xu2019.
WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
WA_POSERVICES-QUANTITY = u2018100.000u2019.
WA_POSERVICES-BASE_UOM = u2018EAu2019.
WA_POSERVICES-PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
WA_POSERVICES- PCKG_NO = u20180000000003u2019.
WA_POSERVICES- LINE_NO = u20180000000002u2019.
WA_POSERVICES-QUANTITY = u201810.000u2019.
WA_POSERVICES- BASE_UOM = u2018EAu2019.
WA_POSERVICES--PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
WA_POSERVICES-MATL_GROUP = u20180012u2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
This logic will work definitely and PO Service Items will be created. -
Order type automatically assign to product wise for order
Hi all,
I gave 4 types of Orders for one plant as per products. The client ask me assign that orders automatically for each product in routing how i will assign please let me know.Actually routing has no relation to order type.
You can use Production Scheduling Profile as well as Production Scheduler/Supervisor.
Firstly, you need to create 4 Production Scheduling Profile and assign 4 Order Type to Prd Sch. Profile.
Then you need to assign the Profile to material in Work Scheduling view.
Another way is that you can create Production Scheduler/Supervisor and assign the Pro Sch Profile to the Prd Scheduler, then assign Prod Scheduler to Material Master in Work Scheduling view also.
From now on, whenever a production order is created for material, order type will be get from the Scheduling Profile.
To maintain the Prd Sch Profile and Prd Scheduler in IMG: Production > Shop Floor COntrol > Master Data -
Sales Representative # not assigned
Dear All.
i created a query based on SAP best practices for Sales Analysis, when i try to create a query to see the Sales by Sales Employee or when i try to drill down in existing query by Sales Representative it gives me # Not Assigned.
please help and let me know where to assign.
kind regards,Hi,
Check if Sales Representative is a characteristic in the underlying info provider(cube or DSO).If so check if has data and whether has a mapping in the transformation.
Or else see if it a navigational attribute...if so, see if the master data for the info object, for which it is an attribute, is loaded.
Also activate master data for that info object.
Hope it helps.
Regards,
Rathy
Maybe you are looking for
-
Why won't itunes work with windows 8.1? i tunes can not locate my music.
Why won't windows 8.1 let itunes locate my music? I deleted and downloaded, still won't do it. But like majic after I installed windows 8.1 my computer had a XBOX music player appear, that found my 3200 songs and it was able to play the entire libr
-
After downloading iOS 7 my speaker and ear buds sound horrible
After downloading ios7 my speaker and ear buds sound horrible
-
IDOC Orders05, conditions and storage location per position
Hello, i have a question regarding WE19 and Orders05 IDOC. I tried to overwrite a pricing condition in the Segment E1EDP05. When i start the Idoc in WE19, i see the new condition placed in the order. Everything seems allright except the price of the
-
Hi, I need to change during runtime the portal theme in EP6 SP4. 1)The theme must chnage for different user groups. 2)If i have an user with a default theme and, when I click over an entry in top level navigation, the portal theme should change depen
-
Hello, Is there a way to print out a list of all your users within a container or tree? Thanks Scott Johnson, CNE Senior Network Analyst 847-583-4113 [email protected]