STR's with an S Loc
Hi All,
We are using one of our WH's as a storage location in SAP & would like to deal with it in terms of STR's for the supply & receipt of products. While I know that we can create STR's using MRP Area concept, in APO (SCM 7.0) the SAP documentation says STR creation with MRP areas is not supported for MTO (make-to-order) process.
Any idea how this can be done or if anyone has tried this before?
Thanks
This forum is only to discuss how the forums operate, not products
If you go to the Forums Index http://forums.adobe.com/index.jspa
You will be able to select a forum for the Adobe product you use
When you go to the correct forum, please do not used white on black background text... it is hard on the eyes
Similar Messages
-
Hello Experts,
I have a scenario in which STR (Stock transport requisition) is FIXED pegged with Forecast and Sales Order.The requirement is, I want to fulfill sales order only with this STR not the forecast.
I am able to change the STR quantity with the pegged quantity with sales order using BAPI ( ie: STR Qty = Pegged Qty of SO) But when I see the pegging overview, in product view (/SAPAPO/RRP3),System is fulfilling forecast first and then sales order.
I tried to change the STR quantity manually in product view,but still it is pegged with forecast first which I dont want.
I want STR to be pegged only with Sales order not with any other order.
Do this require any setting somewhere in SPRO? or this is a normal case in SAP APO? or Do I need to break pegging relationship first then create new pegging relationship with SO only?
Please advice.
Regards,
SaurabhI think we can not break pegging and create new one with desired order.I am not using any SNP engine...
I have tried to change the STR qty but it is automatically respecting forecast first which i dont want to do....I changed order dates,Pegging Strategy in product master also but it is not happening......
I am talking about normal product view in which STR is fixed pegged with the SO and forecast,I want to change STR qty in such a manner that it should fulfill only pegged sales order not any other order.
Please advise me how to achieve this without any planning run?
Regards,
saurabh -
SNMP comm str indexing with a shut VLAN
Hi,
Hope someone can help us with the following. We encounter problems when accessing a Bridge-MIB value using a SNMP comm str index of the VLAN.
The VLAN (interface) in question is shut. If the SNMP comm str index is used for this VLAN, the Cisco device generates SNMP authentication failure traps.
So vb:
VLAN 100 is shut.
executing:
snmpwalk -community public@100 1.3.6.1.2.1.17.4.3.1.1
output:
SNMP authentication failure traps
For us the questions are:
Is this normal behaviour?
Is the SNMP comm string index (MIB instance) available when the VLAN inf is shut?
If so, is it possible to enable the MIB instance eventhough the VLAN inf is shut?
Thanks in advance for the help!!!
Kind RegardsCurrently, there is no existing mib object to shut/no shut a vlan. CLI does allow user to shut down a vlan. Once a user shut down a vlan from the CLI, there is an additional vlan status shown in 'show vlan id xyz', yet there is no MIB objects to show this additional status. vtpVlanState is mapped to the first value in the Status but there should be a way to show additional status.
-
Partial DEL to single sales order with diff storage loc. in single DEL
Hi SAP gurus,
I have created a sales order with single line item of 100 Qty,
Now i want to create single delivery with two different line item with different STORAGE LOCATION as per the availabiliy criteri with those different storage location of the same or different palnt.
i had tried to create single delivery by manually putting second line item with different storage location,but i want this to be automatic by the system.
In case of any clarification kindy revert back to me.
Regards,
UjjawalHi Ujjawal,
Yes its possible only if the plant is the same.
But storage location needs to be enter in the order manually. if you have different storage locations for the items in the order and system will allow you to create a single delivery.
I hope it will help you.
Regards,
SK
Edited by: Mastan Shaik on Jul 22, 2010 7:41 AM -
Prod order with multiple storage loc
R/all
Can any one guide me? is it possible to create production order with multiple storage location?
plz help..
thx
SumitDear Guruji
I have same problem But i want to create PR & PO for multiple storage location.
Thanks
pankaj -
Hi all,
I have the need to set one of the Oracle JDBC properties - with a direct JDBC connection it is done via:
java.util.Properties info = new java.util.Properties();
info.put ("defaultRowPrefetch","15");
getConnection ("jdbc:oracle:oci:@etc",info);
Question is now: how do I set this for a JDBC Connection datasource retrieved from an OC4J Datasource?
Regards.
Anton.Mike,
Did you resolve this? We are seeing a similar problem with our Oracle 9.2.0.5 server connecting from Solaris 5.8.
This isn't a problem with our Oracle 9.2.0.4 servers connecting from the same Solaris system.
-Randy -
Count the items in a column with multiple values?
Hi all
Is there a way to count the items in a column that allows multiple values?
Example list:
Course title: Participants:
Visual Basic Introduction John Smith; Lois Lane; Clark Kent
Visual Basic Advanced John Smith; Lex Luthor
The result should be "3" and "2" (number of participants), which should be displayed in the list or on the page.
Is this possible?
( I am using Sharepoint 2007 and have access to Sharepoint designer.)
Thanks!Hi dee,
We can use XSLT to do this in Data View Web Part.
First, display your list in data view web part.
Insert a new column in the data view, used to display the count.
Switch to code mode, add following code within the <td></td>.
<td>
<xsl:choose>
<xsl:when test="@Title!=''">
<xsl:variable name="count">
<xsl:call-template name="countChar">
<xsl:with-param name="str" select="@Title" />
<xsl:with-param name="count" select="1" />
</xsl:call-template>
</xsl:variable>
count is <xsl:value-of select="$count" />
</xsl:when>
<xsl:otherwise>
count is <xsl:value-of select="0" />
</xsl:otherwise>
</xsl:choose>
</td>
And put the following template definition outside all the other templates.
<xsl:template name="countChar">
<xsl:param name="str" />
<xsl:param name="count" />
<xsl:choose>
<xsl:when test="contains($str, ';')">
<xsl:call-template name="countChar">
<xsl:with-param name="str" select="substring-after($str, ';')" />
<xsl:with-param name="count" select="number($count) + 1" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Done and then you will see the count in the td cell.
I test with Title column and cut off string with ";" character.
Thanks & Regards,
Emir Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please contact [email protected]
Emir Liu
TechNet Community Support -
PROBLEM WITH iMOVIE PROJECT CONVERSION TO QT
I occasionally have strange things happen when converting iMovie (DV) projects to 'full quality' QT.dv files.
Example: footage transferred from a visually pulsating image (originated on a 1920s 30 line mechanical TV scanner invented by J L Baird) has an acceptable rippling effect seen in iMovie. When converted to a QT (full quality) file the rippling becomes a rapid strobing flicker, ie something is changed in conversion. And, DVDs made from each - from the iMovie project and from its QT conversion - produce these same effects.
Any info on what happens in conversion to QT causing this problem?Well...thanks a lot for ur help...!
But...somehow, I feel the settings of my Top-Link Db-Adapter are fine...
(B'coz as far as i can remember, i haven't meddled with it since creating/configuring the DB-Adapter in my ESb project...and there, i could specify my DB Connection ( say, DBConnection1, & could later import the Exact Table i wanted as an Offline Data source (for the routing rule..for Mapping the fields..) )
...i somehow believe there should be a problem with the <ORACLE_HOME>\j2ee\home\application-deployments\default\DbAdapter\oc4j-ra.xml
B'coz as Marc pointed out, i couldn't see any data-source with JNDI name loc/DBConnection1DataSource in my EM console...
So, i tried creating a new data-source there & pointed it to one of the existing connection-pools in the file :-
<ORACLE_HOME>/j2ee/home/config/data-sources.xml
In this connection-pool, i basically set the proper connection-string ("jdbc.thin.....") to point to the proper SID...( as i had set up & tested in my JDeveloper Database Connection..)
Hope my approach is right..??
Or..am i missing something here..??
Thanks a lot again....! -
Controller redundency for aps with 2 diff Locations
hi all,
i have 2 controllers in 2 diff loctaions.in (Location)LOC "A" i have 4400 series WLC with 10 aps are associated in local mode and in LOC "B" is also having new 5500 series WLC with 25 aps are associated in local mode .
my question is : if any of the LOC WLC gos down, is it possible to provide WLC redundency with the other LOC WLC, for LOC A and LOC B APs ?
if it is possible pelase tell what need to be done.
please help me in that issue .
regards,
VenkatHi Venky,
If both the wlc are reachable from AP then you can configure Primary, Secondary controller on the AP.
To configure it -
Wireless --- > Select an AP --- > High Availability
Thanks -
How to work with loops if certain condition to be fulfill.
Hi,
I have following conditions.
itab1
seq plant storage loc material
01 p1 s1 m1
02 p2 s2 m1
03 p3 s3 m1
itab2
material plant storage loc. date qty. mrp area
m1 p1 s1 00000000 0 or q1 mr1
m1 p1 s1 20140102 0 or q1 mr1
m1 p1 s2 00000000 0 or q1 mr1
m1 p1 s3 00000000 0 or q1 mr2
m1 p1 s3 20140102 0 or q1 mr2
now I have to pick the qty from itab 2 as follow.
I need to see first seq (01) in itab1 first and for that I have to pick the desired qty (suppose 6). first with the storage loc s1.
it should search in itab2 for s1 with date 000000.this belongs to mrp area mr1.if it finds the sufficient qty then process the remaing logic otherwise
it should search with other storage loc s2 in same mrp area MR1 where date is 000000.if not then go with s3 but as s3 has diff mrp area.so now it should come back and search with s1 where date is not 0000000. then with s2 with same condition.after that it should go with other mrp area.
I am trying but not able to achieve it completely. please help me to code this.Hi Prashant,
Please find the below code.
"Loop the Header table
LOOP AT ITAB1 INTO WA_TAB1.
"Read the Item table
READ TABLE ITAB2
INTO WA_TAB2
WITH KEY MATERIAL = WA_TAB1-MATERIAL
PLANT = WA_TAB1-PLANT
STORAGE_LOC = WA_TAB1-STORAGE_LOC.
IF SY-SUBRC = 0.
IF WA_TAB2-QTY = 0.
"Copy the Internal Table
ITAB2_COPY[] = ITAB2[].
"Delete Internal Table for different MRP
DELETE ITAB2_COPY WHERE MRP NE WA_TAB2-MRP.
"Sort the Internal Table
SORT ITAB2_COPY
BY MATERIAL
PLANT
MRP
STORAGE_LOC.
"Delete the Adjacent record for Storage location
DELETE ADJACENT DUPLICATES ITAB2_COPY COMPARING MATERIAL
PLANT
MRP
STORAGE_LOC.
"Using Parallel cursor read the next records from Item table
LOOP AT ITAB2_COPY INTO WA_TAB_CP.
"Check condition for different materials
IF MATERIAL = WA_TAB2-MATERIAL
PLANT = WA_TAB2-PLANT
MRP = WA_TAB2-MRP.
"Exit from the Loop
EXIT.
ENDIF.
"Check Quantity
IF WA_TAB_CP-QTY <> 0.
"Move the corresponding value
MOVE-CORRESPONDING WA_TAB_CP TO WA_FINAL.
"Assign Quantity
WA_FINAL-QTY = WA_TAB_CP-QTY.
"Append Internal Table
APPEND WA_FINAL TO IT_FINAL.
"Clear WA
CLEAR WA_FINAL.
"Come out from the Loop
EXIT.
ELSE.
"Continue the next Record
CONTINUE.
ENDIF.
ENDLOOP.
ELSE.
"Move the corresponding value
MOVE-CORRESPONDING WA_TAB2 TO WA_FINAL.
"Assign Quantity
WA_FINAL-QTY = WA_TAB2-QTY.
"Append Internal Table
APPEND WA_FINAL TO IT_FINAL.
"Clear WA
CLEAR WA_FINAL.
"Continue the next Record
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
Regards
Rajkumar Narasimman
Message was edited by: Rajkumar N -
STR (S3) wouldn't work!!!
MOBO: KT3 Unltra2 (MS-6380E)
RAM:Kingmax 333/2700 CAS2.5
OS:win2k
Problem is, the system would go to suspend mode, but wouldn't wake up from it properly. It wakes up with blank screen and sits there. call vga init option under BIOS didn't make any difference.
I've once had similar problem with my old Epox board and PC133 Kingmax RAM. I had to replace it with Hyundai brand to make it work.
I wonder if Kingmax DDR RAM still has this problem.
Has any of you had STR problem with Kingmax RAM?
Do you know if Samsung brand DDR RAM works with STR?Morning vikram17000,
Thanks for using Apple Support Communities.
For more information on this, take a look at this article:
iPhone: Hardware troubleshooting
http://support.apple.com/kb/ts2802
Display has no backlight or dark screen
Toggle the ringer switch to see if the unit vibrates. If it does, it could be that iPhone is getting power, but is not displaying any image.
Try turning iPhone off and then on again.
While connected to the iPhone charger, try to reset the iPhone.
If the low-battery screen appears, charge the iPhone.
Hope this helps,
Mario -
Error while binding data into Node which is Created Dynamically.
Hi All
We have a scenario , which is to create the Context and its attribute dynamically at runtime. When I create the context with structure. Using the method <b>create_nodeinfo_from_struct()</b>.here the attributes under the created node is automatically taken from the provided structure SPFLI.
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = DYN
structure_name = SPFLI
is_multiple = abap_true ).
Using the above method it is working fine and I could bind the value into the node.
But our scenario is to create context and its attributes without giving any predefined structure. We need to add attributes manually giving one by one.
For that I have used the method rootnode_info->add_new_child_node &
dyn_node->add_attribute( exporting attribute_info = ls_attribute ).
But am getting short dumb showing <b>Line types of an internal table and a work area not compatible.</b>
Please give me a solution..
I used the following code .
data:
rootnode_info type ref to if_wd_context_node_info,
dyn_node type ref to if_wd_context_node,
data :ls_attribute type wdr_context_attribute_info.
rootnode_info = wd_context->get_node_info( ).
call method rootnode_info->add_new_child_node
exporting
SUPPLY_METHOD =
SUPPLY_OBJECT =
DISPOSE_METHODS =
DISPOSE_OBJECT =
STATIC_ELEMENT_TYPE =
name = 'DYN'
is_mandatory = abap_false
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
is_singleton = abap_true
is_initialize_lead_selection = abap_true
STATIC_ELEMENT_RTTI =
is_static = abap_false
ATTRIBUTES =
receiving
child_node_info = node_nsp
ls_attribute-name = 'CARRID'.
ls_attribute-type_name = 'S_CARR_ID'.
ls_attribute-value_help_mode = '0'.
node_nsp->add_attribute( exporting attribute_info = ls_attribute ).
ls_attribute-name = 'CONNID'.
ls_attribute-type_name = 'S_CONN_ID'.
ls_attribute-value_help_mode = '0'.
node_nsp->add_attribute( exporting attribute_info = ls_attribute ).
DATA : BEGIN OF str,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
END OF str.
DATA : it_str LIKE TABLE OF str.
select carrid connid from spfli into corresponding fields of table it_str
dyn_node = wd_context->get_child_node( name = 'DYN' ).
dyn_node->bind_table( it_str ).
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_usage( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv_usage( ).
l_ref_interfacecontroller->set_data(
r_node_data = dyn_node " Ref to if_Wd_Context_Node
Thanks in advance..
Nojish
Message was edited by:
nojish pHi Nojish.
I gues the error happens when you try to read the static attributes of an element of
you dynamic node. This does not work using your defined type str, cause with
get_static_attribute you only receive the static and not the dynamic attributes.
Static attributes are attributes that are defined at design time. Thats why the
structure does not match.
But you can use the following code to get your dynamic attributes, for example
getting the lead selection element and the attribute carrid:
dyn_node = wd_context->get_child_node( name = 'DYN' ).
lr_elelement = dyn_node->get_element( ).
lr_el->get_attribute(
EXPORTING
name = 'CARRID'
IMPORTING
value = lv_carrid
Hope this helps.
PS: Or do you get the reerror in above code? Your code works here. If so pls provide short dump.
Cheers,
Sascha
Message was edited by:
Sascha Dingeldey -
Bapi for creating purchase order
hi, iam using BAPI_PO_CREATE1 to create PO's for service. after creating opne PO if i go and create another po within a short span of a minute or so then it does not create the second PO. it gives message that doc does not contain any items.
TABLES: ekpo,zcta_podates,ekko.
DATA iekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
DATA iekko LIKE ekko OCCURS 0 WITH HEADER LINE.
DATA ipodates LIKE zcta_podates OCCURS 0 WITH HEADER LINE.
DATA : wabldat1 LIKE zcta_podates-podat.
DATA : wabldat2 LIKE zcta_podates-podat.
DATA : wabldat3 LIKE zcta_podates-podat.
DATA : wabldat4 LIKE zcta_podates-podat.
DATA : wabldat5 LIKE zcta_podates-podat.
DATA : wabldat6 LIKE zcta_podates-podat.
DATA : wabldat7 LIKE zcta_podates-podat.
DATA :fname1 TYPE string.
DATA :w_fname1 TYPE string.
DATA : BEGIN OF itab1 OCCURS 0 ,
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(15),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlangu LIKE ekpo-zzlangu,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab1.
DATA :BEGIN OF itab2 OCCURS 0, " radio
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab2.
DATA :BEGIN OF itab3 OCCURS 0, "tv
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzgenre LIKE ekpo-zzgenre,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
zzlangu LIKE ekpo-zzlangu,
zzcity(20), " LIKE ekpo-zzcity,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab3.
DATA :BEGIN OF itab4 OCCURS 0, "OUTDOOR
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zztypeofad LIKE ekpo-zztypeofad,
zztrafficdirtn LIKE ekpo-zztrafficdirtn,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab4.
DATA :BEGIN OF itab5 OCCURS 0, "INTERNET
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zztypeofad LIKE ekpo-zztypeofad,
zzsection LIKE ekpo-zzsection,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab5.
DATA :BEGIN OF itab6 OCCURS 0, "CINEMA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzcity LIKE ekpo-zzcity,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zzcinemaname LIKE ekpo-zzcinemaname,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab6.
DATA :BEGIN OF itab7 OCCURS 0, "OTHER MEDIA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
val4(10),
zzformat LIKE ekpo-zzformat,
zcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
zzlangu LIKE ekpo-zzlangu,
zzgenre LIKE ekpo-zzgenre,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zzsection LIKE ekpo-zzsection,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab7.
DATA :BEGIN OF itab8 OCCURS 0, "NO MEDIA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
qty(12),
gross(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzcity LIKE ekpo-zzcity,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab8.
DATA : BEGIN OF str OCCURS 0,
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(15),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
val4(10),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlangu LIKE ekpo-zzlangu,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
zzillumination LIKE ekpo-zzillumination ,
zztrafficdirtn LIKE ekpo-zztrafficdirtn ,
zzstore LIKE ekpo-zzstore ,
zzcasting LIKE ekpo-zzcasting ,
zzgenre LIKE ekpo-zzgenre ,
zzsection LIKE ekpo-zzsection ,
zznumberofdays LIKE ekpo-zznumberofdays ,
zzprogramname LIKE ekpo-zzprogramname ,
zzdealstructure LIKE ekpo-zzdealstructure ,
zztimeband LIKE ekpo-zztimeband ,
zzdate LIKE ekpo-zzdate ,
zzdaysofwk LIKE ekpo-zzdaysofwk ,
zzasnum LIKE ekpo-zzasnum ,
zzlocationorroad LIKE ekpo-zzlocationorroad ,
zzcinemaname LIKE ekpo-zzcinemaname ,
zzcapacity LIKE ekpo-zzcapacity ,
zzfield2 LIKE ekpo-zzfield2 ,
zzfield3 LIKE ekpo-zzfield3 ,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF str.
DATA :package(10) TYPE n VALUE '4747'.
DATA :subpackage(10) TYPE n VALUE '4748'.
DATA : l_po_header LIKE bapimepoheader.
DATA : l_po_headerx LIKE bapimepoheaderx.
DATA : l_purchaseorder LIKE bapimepoheader-po_number.
DATA : t_po_account LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE.
DATA : t_po_accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE.
DATA : t_po_servalue LIKE bapiesklc OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF t_po_items OCCURS 0.
INCLUDE STRUCTURE bapimepoitem.
DATA : END OF t_po_items.
DATA : BEGIN OF t_po_itemsx OCCURS 0.
INCLUDE STRUCTURE bapimepoitemx.
DATA : END OF t_po_itemsx.
DATA : BEGIN OF t_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA : END OF t_return.
DATA : BEGIN OF t_po_services OCCURS 0.
INCLUDE STRUCTURE bapiesllc.
DATA : END OF t_po_services.
DATA: l_item(5) TYPE n,l_last_po(10).
*TABLES : zerror.
DATA lcounter(3) TYPE n.
DATA : l_errflag.
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER:x_lifnr LIKE ekko-lifnr .
PARAMETER:x_ekorg LIKE ekko-ekorg DEFAULT '9000' .
PARAMETER:x_ekgrp LIKE ekko-ekgrp .
PARAMETER:x_bukrs LIKE ekko-bukrs DEFAULT '0101' .
PARAMETER:x_bsart LIKE ekko-bsart DEFAULT 'ZNB1'.
PARAMETER:x_sdate LIKE ekko-bedat.
PARAMETER : x_edate LIKE ekko-bedat.
PARAMETER: pr_fn1 LIKE ibipparms-path OBLIGATORY.
PARAMETER: rad1 RADIOBUTTON GROUP gr1.
PARAMETER: rad2 RADIOBUTTON GROUP gr1.
PARAMETER: rad3 RADIOBUTTON GROUP gr1.
PARAMETER: rad4 RADIOBUTTON GROUP gr1.
PARAMETER: rad5 RADIOBUTTON GROUP gr1.
PARAMETER: rad6 RADIOBUTTON GROUP gr1.
PARAMETER: rad7 RADIOBUTTON GROUP gr1.
PARAMETER: rad8 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN:END OF BLOCK b1 .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_fn1.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = pr_fn1.
MOVE pr_fn1 TO w_fname1.
START-OF-SELECTION.
IF rad1 = 'X'.
PERFORM table_upload TABLES itab1.
ELSEIF rad2 = 'X'.
PERFORM table_upload TABLES itab2.
ELSEIF rad3 = 'X'.
PERFORM table_upload TABLES itab3.
ELSEIF rad4 = 'X'.
PERFORM table_upload TABLES itab4.
ELSEIF rad5 = 'X'.
PERFORM table_upload TABLES itab5.
ELSEIF rad6 = 'X'.
PERFORM table_upload TABLES itab6.
ELSEIF rad7 = 'X'.
PERFORM table_upload TABLES itab7.
ELSEIF rad8 = 'X'.
PERFORM table_upload TABLES itab8.
ENDIF.
LOOP AT str.
SHIFT str-srvpos RIGHT DELETING TRAILING ' '.
OVERLAY str-srvpos WITH '00000000000000000'.
MODIFY str.
ENDLOOP.
CLEAR : l_po_header.
PERFORM create_po_header.
LOOP AT str FROM 2 .
PERFORM append_item.
ENDLOOP.
PERFORM create_po.
WAIT UP TO 5 SECONDS.
SELECT * FROM ekpo INTO CORRESPONDING FIELDS OF TABLE iekpo WHERE ebeln = l_purchaseorder.
COMMIT WORK.
WAIT UP TO 5 SECONDS.
LOOP AT iekpo.
l_item = sy-tabix + 1.
READ TABLE str INDEX l_item.
iekpo-zzfield2 = str-zzfield2 .
iekpo-zzfield3 = str-zzfield3 .
iekpo-zzformat = str-zzformat .
iekpo-zzmeansofad = str-zzmeansofad .
iekpo-zzedition = str-zzedition .
iekpo-zzcolorhue = str-zzcolorhue .
iekpo-zztypeofad = str-zztypeofad .
iekpo-zzcity = str-zzcity .
iekpo-zzlangu = str-zzlangu .
iekpo-zzdaysofwk = str-zzdaysofwk .
iekpo-zzasnum = str-zzasnum .
iekpo-zzlocationorroad = str-zzlocationorroad .
iekpo-zzcinemaname = str-zzcinemaname .
iekpo-zzcapacity = str-zzcapacity .
iekpo-zzcampaign = str-zzcampaign .
iekpo-zzillumination = str-zzillumination .
iekpo-zztrafficdirtn = str-zztrafficdirtn .
iekpo-zzstore = str-zzstore .
iekpo-zzcasting = str-zzcasting .
iekpo-zzgenre = str-zzgenre .
iekpo-zzsection = str-zzsection .
iekpo-zznumberofdays = str-zznumberofdays .
iekpo-zzprogramname = str-zzprogramname .
iekpo-zzdealstructure = str-zzdealstructure .
iekpo-zztimeband = str-zztimeband .
iekpo-zzdate = str-zzdate .
MODIFY iekpo.
ENDLOOP.
WAIT UP TO 2 SECONDS.
COMMIT WORK.
WAIT UP TO 15 SECONDS.
UPDATE ekpo FROM TABLE iekpo.
COMMIT WORK.
WAIT UP TO 2 SECONDS.
SELECT * FROM ekko INTO CORRESPONDING FIELDS OF TABLE iekko WHERE ebeln = l_purchaseorder.
LOOP AT iekko.
iekko-kdatb = x_sdate.
iekko-kdate = x_edate.
MODIFY iekko.
ENDLOOP.
UPDATE ekko FROM TABLE iekko.
COMMIT WORK.
WAIT UP TO 1 SECONDS.
CLEAR l_item.
l_item = 10.
LOOP AT str FROM 2 .
CONCATENATE str-date1+6(4) str-date1+3(2) str-date1(2) INTO wabldat1.
CONCATENATE str-date2+6(4) str-date2+3(2) str-date2(2) INTO wabldat2.
CONCATENATE str-date3+6(4) str-date3+3(2) str-date3(2) INTO wabldat3.
CONCATENATE str-date4+6(4) str-date4+3(2) str-date4(2) INTO wabldat4.
CONCATENATE str-date5+6(4) str-date5+3(2) str-date5(2) INTO wabldat5.
CONCATENATE str-date6+6(4) str-date6+3(2) str-date6(2) INTO wabldat6.
CONCATENATE str-date7+6(4) str-date7+3(2) str-date7(2) INTO wabldat7.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '001'.
ipodates-podat = wabldat1.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '002'.
ipodates-podat = wabldat2.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '003'.
ipodates-podat = wabldat3.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '004'.
ipodates-podat = wabldat4.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '005'.
ipodates-podat = wabldat5.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '006'.
ipodates-podat = wabldat6.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '007'.
ipodates-podat = wabldat7.
APPEND ipodates.
l_item = l_item + 10.
ENDLOOP.
WAIT UP TO 1 SECONDS.
MODIFY zcta_podates FROM TABLE ipodates.
COMMIT WORK.
WAIT UP TO 2 SECONDS.
ipodates-podat,ipodates-ebeln,ipodates-ebelp,ipodates-linno.
WAIT UP TO 5 SECONDS.
LOOP AT t_return.
WRITE :/ t_return-message.
ENDLOOP.
free : ipodates,iekpo,str,itab1,itab2,itab3,itab4,itab5,itab6,itab7,itab8.
*& Form create_po_header
FORM create_po_header .
l_po_header-comp_code = '0101'. " Company Code
l_po_header-doc_type = x_bsart. "'ZNB1'. " Order Typr BSART
l_po_header-creat_date = sy-datum. " P.O Dt - BEDAT
l_po_header-doc_date = sy-datum.
l_po_header-vendor = x_lifnr.
l_po_header-vper_start = x_sdate.
l_po_header-vper_end = x_edate.
l_po_header-purch_org = '9000'. " Purch. Org - EKKO-EKORG
l_po_header-pur_group = x_ekgrp. " Purch Group - EKKO-EKGRP
l_po_header-currency_iso = 'INR'.
CLEAR : l_po_headerx.
l_po_headerx-po_number = 'X'.
l_po_headerx-comp_code = 'X'." Company Code
l_po_headerx-doc_type = 'X'. " Order Typr BSART
l_po_headerx-vendor = 'X'. "Vendor - EKKO-LIFNR
l_po_headerx-purch_org = 'X'. " Purch. Org - EKKO-EKORG
l_po_headerx-pur_group = 'X'. " Purch Group - EKKO-EKGRP
l_po_headerx-currency_iso = 'X'. " Currency Default field for Enjoy
l_po_headerx-ref_1 = 'X'.
ENDFORM. " create_po_header
*& Form APPEND_ITEM
FORM append_item .
package = package + 2.
subpackage = package + 1.
l_item = l_item + 10.
t_po_items-po_item = l_item.
t_po_items-acctasscat = 'K'.
t_po_items-item_cat = 'D'.
t_po_items-short_text = str-txz01. .
t_po_items-plant = str-werks . " P
t_po_items-tax_code = 'S1'.
t_po_items-pckg_no = package. " 4748. "package.
APPEND t_po_items.
CLEAR t_po_items.
t_po_itemsx-po_item = l_item.
t_po_itemsx-po_itemx = 'X'.
t_po_itemsx-acctasscat = 'X'.
t_po_itemsx-item_cat = 'X'.
t_po_itemsx-short_text = 'X'.
t_po_itemsx-plant = 'X'.
t_po_itemsx-tax_code = 'X'.
t_po_itemsx-pckg_no = 'X'.
APPEND t_po_itemsx.
CLEAR t_po_itemsx.
t_po_account-po_item = l_item.
t_po_account-serial_no = 1.
t_po_account-quantity = 1.
t_po_account-distr_perc = '00'.
t_po_account-costcenter = '0006079000'. " 'BR034'.
t_po_account-gl_account = '0054014071'. "'0000135075'.
t_po_account-co_area = '1001'.
APPEND t_po_account.
CLEAR t_po_account.
t_po_accountx-po_item = l_item.
t_po_accountx-serial_no = 1.
t_po_accountx-quantity = 'X'.
t_po_accountx-distr_perc = 'X'.
t_po_accountx-costcenter = 'X'.
t_po_accountx-gl_account = 'X'.
t_po_accountx-co_area = 'X'.
APPEND t_po_accountx.
CLEAR t_po_accountx.
t_po_services-pckg_no = package. "'4748'.
t_po_services-line_no = '0000000001' .
t_po_services-ext_line = '0000000000' .
t_po_services-outl_level = '0'.
t_po_services-outl_no = ' '.
t_po_services-outl_ind = 'X'.
t_po_services-subpckg_no = subpackage . "'4749'.
APPEND t_po_services. CLEAR t_po_services .
t_po_services-pckg_no = subpackage . "'4749'.
t_po_services-line_no = '0000000002' .
t_po_services-ext_line = '10' .
t_po_services-outl_level = '0'.
t_po_services-service = str-srvpos. "'000000000003000045'.
t_po_services-gr_price = str-gross. "'2000.00'.
t_po_services-form_val1 = str-val1. "'10.000'.
t_po_services-form_val2 = str-val2. "'33.000'.
if rad1 = 'x'.
t_po_services-form_val3 = str-val3. " '3.000'.
endif.
t_po_services-tax_code = 'S1'.
APPEND t_po_services. CLEAR t_po_services .
t_po_servalue-pckg_no = subpackage . "'4749'.
t_po_servalue-line_no = '0000000002' .
t_po_servalue-serial_no = '01'.
APPEND t_po_servalue . CLEAR t_po_servalue.
ENDFORM. " APPEND_ITEM
*& Form create_po
FORM create_po .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = l_po_header
poheaderx = l_po_headerx
IMPORTING
exppurchaseorder = l_purchaseorder
TABLES
return = t_return
poitem = t_po_items
poitemx = t_po_itemsx
poaccount = t_po_account
poaccountx = t_po_accountx
poservices = t_po_services
posrvaccessvalues = t_po_servalue
WAIT UP TO 15 SECONDS.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDFORM. " create_po
*& Form TABLE_UPLOAD
FORM table_upload TABLES p_itab1. " structure < itab1 #local# >
"Insert correct name for <...>.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_fname1
filetype = 'ASC'
has_field_separator = 'X'
read_by_line = 'X'
replacement = '#'
TABLES
data_tab = p_itab1.
LOOP AT p_itab1.
MOVE-CORRESPONDING p_itab1 TO str.
APPEND str.
CLEAR p_itab1.
ENDLOOP.
* WAIT UP TO 5 SECONDS.
ENDFORM. " TABLE_UPLOADHi,
Check this sample code..how to use the BAPI_PO_CREATE1.
REPORT Z_TEST_PO .
*DATA DECLARATION
CONSTANTS : C_X VALUE 'X'.
*Structures to hold PO header data
DATA : HEADER LIKE BAPIMEPOHEADER ,
HEADERX LIKE BAPIMEPOHEADERX .
*Structures to hold PO account data
DATA : ACCOUNT LIKE BAPIMEPOACCOUNT OCCURS 0 WITH HEADER LINE ,
ACCOUNTX LIKE BAPIMEPOACCOUNTX OCCURS 0 WITH HEADER LINE .
*Internal Tables to hold PO ITEM DATA
DATA : ITEM LIKE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,
ITEMX LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
POCONTRACTLIMITS LIKE BAPIESUCC OCCURS 0 WITH HEADER LINE.
DATA : W_HEADER(40) VALUE 'PO Header',
PURCHASEORDER LIKE BAPIMEPOHEADER-PO_NUMBER,
DELIVERY_DATE LIKE BAPIMEPOSCHEDULE-DELIVERY_DATE.
DATA : WS_LANGU LIKE SY-LANGU.
*text-001 = 'PO Header' - define as text element
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : COMPANY LIKE HEADER-COMP_CODE DEFAULT '122' ,
DOCTYP LIKE HEADER-DOC_TYPE DEFAULT 'NB' ,
CDATE LIKE HEADER-CREAT_DATE DEFAULT SY-DATUM ,
VENDOR LIKE HEADER-VENDOR DEFAULT '2000000012' ,
PUR_ORG LIKE HEADER-PURCH_ORG DEFAULT 'PU01' ,
PUR_GRP LIKE HEADER-PUR_GROUP DEFAULT '005' .
*sociedad like HEADER-COMP_CODE default '122' ,
*vendedor like HEADER-SALES_PERS default 'sale person'.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : ITEM_NUM LIKE ITEM-PO_ITEM DEFAULT '00010',
MATERIAL LIKE ITEM-MATERIAL DEFAULT '12000000' ,
TIPO_IMP LIKE ITEM-ACCTASSCAT DEFAULT 'K' ,
*pos_doc like ITEM-ITEM_CAT default 'F' ,
SHORTTXT LIKE ITEM-SHORT_TEXT DEFAULT 'PRUEBA BAPI' ,
GRUP_ART LIKE ITEM-MATL_GROUP DEFAULT '817230000' ,
PLANT LIKE ITEM-PLANT DEFAULT '3001' ,
MPE LIKE ITEM-TRACKINGNO DEFAULT '9999' ,
*contrato like ITEM-AGREEMENT default '4904000003' ,
*quantity like ITEM-QUANTITY default 1 .
PO_UNIT LIKE ITEM-PO_UNIT DEFAULT 'EA'.
SELECTION-SCREEN END OF BLOCK B2.
* Par?mnetros de imputaci?n
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-004.
PARAMETERS : CENTRO LIKE ACCOUNT-COSTCENTER DEFAULT '1220813150',
CUENTA LIKE ACCOUNT-GL_ACCOUNT DEFAULT '6631400' ,
NUM_POS LIKE ACCOUNT-PO_ITEM DEFAULT '10' ,
SERIAL LIKE ACCOUNT-SERIAL_NO DEFAULT '01' ,
IND_IMP LIKE ACCOUNT-TAX_CODE DEFAULT 'I2' .
SELECTION-SCREEN END OF BLOCK B3.
START-OF-SELECTION.
*DATA POPULATION
WS_LANGU = SY-LANGU. "Language variable
*POPULATE HEADER DATA FOR PO
*HEADER-COMP_CODE = sociedad .
HEADER-DOC_TYPE = DOCTYP .
HEADER-VENDOR = VENDOR .
HEADER-CREAT_DATE = CDATE .
HEADER-CREATED_BY = 'TD17191' .
HEADER-PURCH_ORG = PUR_ORG .
HEADER-PUR_GROUP = PUR_GRP .
HEADER-COMP_CODE = COMPANY .
HEADER-LANGU = WS_LANGU .
*HEADER-SALES_PERS = vendedor .
*HEADER-CURRENCY = 'DOP' .
*HEADER-ITEM_INTVL = 10 .
*HEADER-PMNTTRMS = 'N30' .
*HEADER-EXCH_RATE = 1 .
*POPULATE HEADER FLAG.
HEADERX-COMP_CODE = C_X.
HEADERX-DOC_TYPE = C_X.
HEADERX-VENDOR = C_X.
HEADERX-CREAT_DATE = C_X.
HEADERX-CREATED_BY = C_X.
HEADERX-PURCH_ORG = C_X.
HEADERX-PUR_GROUP = C_X.
HEADERX-LANGU = C_X.
*HEADERX-sales_pers = c_x.
*HEADERX-CURRENCY = c_x.
*HEADER-ITEM_INTVL = c_x.
*HEADER-PMNTTRMS = c_x.
*HEADER-EXCH_RATE = c_x.
*HEADER-EXCH_RATE = c_x.
*POPULATE ITEM DATA.
ITEM-PO_ITEM = ITEM_NUM.
ITEM-QUANTITY = '1'.
*ITEM-MATERIAL = material .
ITEM-SHORT_TEXT = 'prueba bapi_po_create1'.
*ITEM-TAX_CODE = ''.
ITEM-ACCTASSCAT = 'K' .
*ITEM-ITEM_CAT = 'D' .
ITEM-MATL_GROUP = '817230000' .
ITEM-PLANT = '3001' .
ITEM-TRACKINGNO = '99999'.
ITEM-PREQ_NAME = 'test'.
*ITEM-AGREEMENT = '' .
*ITEM-AGMT_ITEM = ''.
ITEM-QUANTITY = '1' .
ITEM-PO_UNIT = 'EA'.
*ITEM-ORDERPR_UN = 'EA'.
ITEM-CONV_NUM1 = '1'.
ITEM-CONV_DEN1 = '1'.
ITEM-NET_PRICE = '1000000' .
ITEM-PRICE_UNIT = '1'.
ITEM-GR_PR_TIME = '0'.
ITEM-PRNT_PRICE = 'X'.
ITEM-UNLIMITED_DLV = 'X'.
ITEM-GR_IND = 'X' .
ITEM-IR_IND = 'X' .
ITEM-GR_BASEDIV = 'X'.
*ITEM-PCKG_NO = '' .
APPEND ITEM. CLEAR ITEM.
*POPULATE ITEM FLAG TABLE
ITEMX-PO_ITEM = ITEM_NUM.
ITEMX-PO_ITEMX = C_X.
*ITEMX-MATERIAL = C_X.
ITEMX-SHORT_TEXT = C_X.
ITEMX-QUANTITY = C_X.
*ITEMX-TAX_CODE = C_X.
ITEMX-ACCTASSCAT = C_X.
*ITEMX-ITEM_CAT = c_x.
ITEMX-MATL_GROUP = C_X.
ITEMX-PLANT = C_X.
ITEMX-TRACKINGNO = C_X.
ITEMX-PREQ_NAME = C_X.
*ITEMX-AGREEMENT = C_X.
*ITEMX-AGMT_ITEM = c_x.
ITEMX-STGE_LOC = C_X.
ITEMX-QUANTITY = C_X.
ITEMX-PO_UNIT = C_X.
*ITEMX-ORDERPR_UN = C_X.
ITEMX-CONV_NUM1 = C_X.
ITEMX-CONV_DEN1 = C_X.
ITEMX-NET_PRICE = C_X.
ITEMX-PRICE_UNIT = C_X.
ITEMX-GR_PR_TIME = C_X.
ITEMX-PRNT_PRICE = C_X.
ITEMX-UNLIMITED_DLV = C_X.
ITEMX-GR_IND = C_X .
ITEMX-IR_IND = C_X .
ITEMX-GR_BASEDIV = C_X .
APPEND ITEMX. CLEAR ITEMX.
*POPULATE ACCOUNT DATA.
ACCOUNT-PO_ITEM = ITEM_NUM.
ACCOUNT-SERIAL_NO = SERIAL .
ACCOUNT-CREAT_DATE = SY-DATUM .
ACCOUNT-COSTCENTER = CENTRO .
ACCOUNT-GL_ACCOUNT = CUENTA .
ACCOUNT-GR_RCPT = 'tester'.
APPEND ACCOUNT. CLEAR ACCOUNT.
*POPULATE ACCOUNT FLAG TABLE.
ACCOUNTX-PO_ITEM = ITEM_NUM .
ACCOUNTX-PO_ITEMX = C_X .
ACCOUNTX-SERIAL_NO = SERIAL .
ACCOUNTX-SERIAL_NOX = C_X .
ACCOUNTX-CREAT_DATE = C_X .
ACCOUNTX-COSTCENTER = C_X .
ACCOUNTX-GL_ACCOUNT = C_X .
ACCOUNT-GR_RCPT = C_X.
APPEND ACCOUNTX. CLEAR ACCOUNTX.
*BAPI CALL
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = HEADER
POHEADERX = HEADERX
IMPORTING
EXPPURCHASEORDER = PURCHASEORDER
TABLES
RETURN = RETURN
POITEM = ITEM
POITEMX = ITEMX
POACCOUNT = ACCOUNT
POACCOUNTX = ACCOUNTX.
*Confirm the document creation by calling database COMMIT
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
END-OF-SELECTION.
*Output the messages returned from BAPI call
LOOP AT RETURN.
WRITE / RETURN-MESSAGE.
ENDLOOP.
Regards
vijay -
MB5B REPORT & MB51 REPORT ISSUE .
Dear All,
Our user is collecting a monthly report from both these t. code but when he checks report from MB51 the tonnege comingas 29.505 TON but here value is not coming, while through MB5B the report coming as when selecting valuated stock so here the tonnege coming in total reciept as 1.204 TON , as this 1.204 was issued by mvmt type 261 first then it was reversed by 262 , but here use says that in MBFB when selecting strg location / batch stock then the total reciept coming out as 30.709 TON but here the value is not coming as i had double clicked on each tonnege so a GRN Document is dispalyed which was generated when goods reciept by Stock transport order., pl help me how to convince user as user says that the value is not coming for the tonnege 29.505 displaying in MB51 also the value not coming when using MB5B with selecting strg loc / batch stock, Kindly provide feedback for this .
thanx & regards
sap11MB5B will display stock on posting date you need to specify the period and also select the valuation.
MB51 will show the material documents for material movements..
If you go through MB52 that will help....
Regards
Ravi -
How I can change this query, so I can display the name and scores in one r
How I can change this query, so I can add the ID from the table SPRIDEN
as of now is giving me what I want:
1,543 A05 24 A01 24 BAC 24 BAE 24 A02 20 BAM 20in one line but I would like to add the id and name that are stored in the table SPRIDEN
SELECT sortest_pidm,
max(decode(rn,1,sortest_tesc_code)) tesc_code1,
max(decode(rn,1,score)) score1,
max(decode(rn,2,sortest_tesc_code)) tesc_code2,
max(decode(rn,2,score)) score2,
max(decode(rn,3,sortest_tesc_code)) tesc_code3,
max(decode(rn,3,score)) score3,
max(decode(rn,4,sortest_tesc_code)) tesc_code4,
max(decode(rn,4,score)) score4,
max(decode(rn,5,sortest_tesc_code)) tesc_code5,
max(decode(rn,5,score)) score5,
max(decode(rn,6,sortest_tesc_code)) tesc_code6,
max(decode(rn,6,score)) score6
FROM (select sortest_pidm,
sortest_tesc_code,
score,
row_number() over (partition by sortest_pidm order by score desc) rn
FROM (select sortest_pidm,
sortest_tesc_code,
max(sortest_test_score) score
from sortest,SPRIDEN
where
SPRIDEN_pidm =SORTEST_PIDM
AND sortest_tesc_code in ('A01','BAE','A02','BAM','A05','BAC')
and sortest_pidm is not null
GROUP BY sortest_pidm, sortest_tesc_code))
GROUP BY sortest_pidm;
Hi,
That depends on whether spriden_pidm is unique, and on what you want for results.
Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevamnt columns only) for all tables, and the results you want from that data.
If you can illustrate your problem using commonly available tables (such as those in the scott or hr schemas) then you don't have to post any sample data; just post the results you want.
Either way, explain how you get those results from that data.
Always say which version of Oracle you're using.
It looks like you're doing something similiar to the following.
Using the emp and dept tables in the scott schema, produce one row of output per department showing the highest salary in each job, for a given set of jobs:
DEPTNO DNAME LOC JOB_1 SAL_1 JOB_2 SAL_2 JOB_3 SAL_3
20 RESEARCH DALLAS ANALYST 3000 MANAGER 2975 CLERK 1100
10 ACCOUNTING NEW YORK MANAGER 2450 CLERK 1300
30 SALES CHICAGO MANAGER 2850 CLERK 950On each row, the jobs are listed in order by the highest salary.
This seems to be analagous to what you're doing. The roles played by sortest_pidm, sortest_tesc_code and sortest_test_score in your sortest table are played by deptno, job and sal in the emp table. The roles played by spriden_pidm, id and name in your spriden table are played by deptno, dname and loc in the dept table.
It sounds like you already have something like the query below, that produces the correct output, except that it does not include the dname and loc columns from the dept table.
SELECT deptno
, MAX (DECODE (rn, 1, job)) AS job_1
, MAX (DECODE (rn, 1, max_sal)) AS sal_1
, MAX (DECODE (rn, 2, job)) AS job_2
, MAX (DECODE (rn, 2, max_sal)) AS sal_2
, MAX (DECODE (rn, 3, job)) AS job_3
, MAX (DECODE (rn, 3, max_sal)) AS sal_3
FROM (
SELECT deptno
, job
, max_sal
, ROW_NUMBER () OVER ( PARTITION BY deptno
ORDER BY max_sal DESC
) AS rn
FROM (
SELECT e.deptno
, e.job
, MAX (e.sal) AS max_sal
FROM scott.emp e
, scott.dept d
WHERE e.deptno = d.deptno
AND e.job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY e.deptno
, e.job
GROUP BY deptno
;Since dept.deptno is unique, there will only be one dname and one loc for each deptno, so we can change the query by replacing "deptno" with "deptno, dname, loc" throughout the query (except in the join condition, of course):
SELECT deptno, dname, loc -- Changed
, MAX (DECODE (rn, 1, job)) AS job_1
, MAX (DECODE (rn, 1, max_sal)) AS sal_1
, MAX (DECODE (rn, 2, job)) AS job_2
, MAX (DECODE (rn, 2, max_sal)) AS sal_2
, MAX (DECODE (rn, 3, job)) AS job_3
, MAX (DECODE (rn, 3, max_sal)) AS sal_3
FROM (
SELECT deptno, dname, loc -- Changed
, job
, max_sal
, ROW_NUMBER () OVER ( PARTITION BY deptno -- , dname, loc -- Changed
ORDER BY max_sal DESC
) AS rn
FROM (
SELECT e.deptno, d.dname, d.loc -- Changed
, e.job
, MAX (e.sal) AS max_sal
FROM scott.emp e
, scott.dept d
WHERE e.deptno = d.deptno
AND e.job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY e.deptno, d.dname, d.loc -- Changed
, e.job
GROUP BY deptno, dname, loc -- Changed
;Actually, you can keep using just deptno in the analytic PARTITION BY clause. It might be a little more efficient to just use deptno, like I did above, but it won't change the results if you use all 3, if there is only 1 danme and 1 loc per deptno.
By the way, you don't need so many sub-queries. You're using the inner sub-query to compute the MAX, and the outer sub-query to compute rn. Analytic functions are computed after aggregate fucntions, so you can do both in the same sub-query like this:
SELECT deptno, dname, loc
, MAX (DECODE (rn, 1, job)) AS job_1
, MAX (DECODE (rn, 1, max_sal)) AS sal_1
, MAX (DECODE (rn, 2, job)) AS job_2
, MAX (DECODE (rn, 2, max_sal)) AS sal_2
, MAX (DECODE (rn, 3, job)) AS job_3
, MAX (DECODE (rn, 3, max_sal)) AS sal_3
FROM (
SELECT e.deptno, d.dname, d.loc
, e.job
, MAX (e.sal) AS max_sal
, ROW_NUMBER () OVER ( PARTITION BY e.deptno
ORDER BY MAX (sal) DESC
) AS rn
FROM scott.emp e
, scott.dept d
WHERE e.deptno = d.deptno
AND e.job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY e.deptno, d.dname, d.loc
, e.job
GROUP BY deptno, dname, loc
;This will work in Oracle 8.1 and up. In Oracle 11, however, it's better to use the SELECT ... PIVOT feature.
Maybe you are looking for
-
Do these issues even have anything to do with MY equipment?
For the last 2 years, we have been having issues on and off with slow connection speeds and loss of connection. When these issues occur, we call tech support, and they generally send out a technician. For the last 2 months, these issues have occurred
-
How to track changes in a custom table
HI all, Requirement is 1. In custom table instead of using table maintence generator ALV gird has to be display to see table entries. But where i have to write the code when user press CONTENTS button? 2. In alv gird there shuld be one button whic
-
Jdk upgradation to 1.6.
Hi, while upgradation of jdk 1.6 i got below error *******FATAL ERROR******* PROGRAM : /prodappl/fnd/11.5.0/patch/115/bin/txkSetJDKCfg. pl(/prodappl/fnd/11.5.0/bin/txkrun.pl) TIME : Wed Jan 30 09:59:20 2008 FUNCTION: TXK::RunScript::getjavaCmd [ Leve
-
Disable Touchpad on EliteBook 2570p permanently
Hi everybody I have a problem with my touchpad: I want to disable it. I can do that by double-tapping the light on the touchpad. However, whenever I double-tap it again it is enabled again. Given that the enable/disable light is *exactly* below the l
-
How to DTW Deposit by using credit card tag - OCRH template path
Hi experts! I need to import full of credit card deposit by using DTW, but I dont know what template i should use.... I mean, I know I use from OCRH table, but I cant find template sample... Do you know the path? Regards... Edited by: Valter Silva on