Multiple Item Codes in a MRP Generated PR
Dear Sir,
We have a requirement to have "Multiple Item Codes" in a single PR . The PR are generated thru MRP . The criterion to have multiple Items in a single PR is that a PR will contain multiple Items codes pertaining to the same Material-Group .
We have come to know that for this MD15 tcode can be used . But the problem with this is that there is manual effort required for clubbing of multiple Items in a single PR from the planned order .
We look forward for some automatic way for handling the above requirement .
Request you to kindly help me on the above issue please .
Regrds
B Mittal
If you are getting Currency key from file then before passing data to BAPI, Check the value of Currency key, if it is not USD then display error message.
Similar Messages
-
MRP for Order Dependent Bill for similar Item Code
Dear All, . . . .Seeking HELP,
Scenario :
We have one item code (say 12345678) in Sales Order (say ABC) which will be attached by order dependent bill ( BOM will be created and attached to this code as per customer's requirement.)
Now again this item code (12345678) is used in another Sales Order ( say XYZ) and another BOM (not similar to S/O ABC) will be created and attached to this customers requirement.
In such scenario I need MRP to be run & consolidated requirement to be generated for common item code (12345678) with multiple order dependent BOMs.
(In above scenario items which are appearing in BOM have unique material group and all items need to be purchased and not to be manufactured)
How it will be configured in SAP ?
Thanking you in advance
Ravi JadavDear Mr.Ravi
Please maintain the following in your case :
1.Goto MMR-Enter Dependent Item as per BOM list -Select MRP4 view -Keep Individiaul /Collective Indiactor as 2
2..Goto MMR-Enter Dependent Item as per BOM list -Select MRP1 view -Keep Lot Sixe as Period Lot Size ( WB/MB/TB)
Make sure that , you have following set up in FG level : refer my thread : Setting nedded for creation of Planned Order for Dependent Requirement.
Do not run MRP in MD50 , it will not planned the SFG if you have at Sales Orde level .
Hope it helps
Regards
JH -
MRP - Single Purchase requisition for multiple Items
Hi
We have recently introduced MRP module in SAP .In some specific scaeanrios , we want to create a single Purchase Requisition for multiple items .Standard SAP generate different Purchase requisition for each item
Is there any way outSandeep,
This topic has been covered numerous times in this forum and in the MM forum. You evidently have not used the search feature. There are thousands of posts in these forums, and the search function will be very helpful for you in future questions.
To answer your question, No, nothing is available to make standard SAP MRP create Purchase requisitions for multiple items.
Most companies address this issue during the conversion of Purchase Requisitions to Purchase orders. During this process, you can add many items to a single purchase order.
Rgds,
DB49 -
Tax code input for Automatically Generated Line Items
Hi Guys,
We want to input a tax code for the Automatically generated line item..for exchange rate differences in F-28.
Once i simulate the F-28 , and i try to input the tax code in the Automatically generated line item for exchange rate difference,
I cannot input the tax code in that screen..and it is greyed out.
Is there a way we can assign a tax code for this GL account line item that is automatically generated by the system ?
Thanks,
Srikanth.Hello,
you have to add the tax code in GL master data. if that's not possible (several codes possible), I would set up a substitution.
kr
Nico -
EDI invoice failed for Service- multiple tax code at service item level
Hi Guys,
Please understand below scenarios, it is very critical to our client.
purchase order has 3 parent
line item which having the 3 services with tax code (P1-P1-P1 and P2-P2-P2 and (P2-P1-C1)
(P1=10%, P2=10% and C1=10%)
PO Outbound Idoc -
Similar tax codes(P1-P1-p1 and P2-P2-P2) - Carries total tax amount and
tax rate at parent level also it carries indvidual service line item
tax amount and tax rate at service item level
Mulitple tax codes(P2-P1-C1)- Carries only total tax amount at parent
level and no tax rate at parent level. It carries indvidual service
line item tax amount and tax rate at service item level
SES Outbound Idoc -
Similar tax codes(P1-P1-p1 and P2-P2-P2) - Carries total tax amount at
parent level segment and tax rate at parent item level also it carries
indvidual service line item tax amount and tax rate at service item
level
Mulitple tax codes(P2-P1-C1)- Carries only total tax amount at parent
level and no tax rate at parent level. It carries indvidual service
line item tax amount and tax rate at service item level
But while creating the invoice for parent line item which includes 3
services, it carries correct tax amount(as per PO and SESR) but it is
asking for tax rate at parent level not at service item level.
It is working fine for similar tax code at service line item (e.g P1-P1-p1 for 3 services or P2-P2-P2 for all 3 services) but when we use the combination of tax code or multiple tax code at service line items (e.g. P2-P1-C1), the inbound Idoc gets failed.
Expectation - How EDI invoice posted for mulitple Services under one parent line item which having multiple tax codes at service item level
Thanks
Sanjay
9930851236This is an ongoing problem with lots of clients - did anyone solve it ?
-
How to generate item codes automatically
Hi,
My customer wants that the inventory item code be generated automatically based on its description. The code should have:
- 3 first characters of the description
- A sequential increased number, to make the code unique.
e.g. the item called "Petrol" should have the code "pet004".
To achieve this, I have created a database procedure. So the user that works in "Item Master" form, will fill out "description" field and the "Item" field should be automatically populated based on the return value of this procedure.
Is there any way how to achieve this through personalization?
Or, is there any standard way that Oracle offers for automatic generation of item codes?
Thank youlHi,
You have to do it using forms personalization.
Thanks,
PS. -
How to create Item Codes with multiple Item Description
Hi,
for one of my client, we need to create Item Codes with multiple Item Description.
e.g.,
Item Code - M00285
Item Description 1 - Blue Paint
Item Description 2 - Red Paint
Is that possible in SAP Business One? If "Yes" kindly provide a solution. Else recommend an alternative method.
Regards,
Ammheya U. NaaikAmmheya,
I just wanted to add that there is an Add-On that handles "Style, Color, Size" situations like yours.
It allows you to define a "master" item, (Paint, for example) and then setup the various styles, colors and sizes it comes in.
This creates sub-items for each with the master in the ItemCode (Paint-Blue, Paint-Red, etc)
It's called MatrixOne from Navigator. You could find it on the partner portal with other Add-Ons.
Hope thathelps,
Brad Windecker -
Item Number in MRP generated PR missing
Hi all
I am encountering a little problem in my MRP Run. All of the MRP generated PRs I have do not have the item number in the PRs. This creates a problem in the ABAP report that we are using.
What causes this and how do I solve it?
Please helpHi Obie,
Can you just elebarate little more about your problem. Is the item number tab displayed in the PR? If displayed and its blank then apart from OMDV also check PR document type settings with the help of your MM consultant or follow the below mentioned path for it.
IMG->Materials Management->Purchasing->Purchase Requisition->Define Document Types.
And if its not displayed in the PR screen then just check the Layout for PR.
Regards,
Hiren -
How to change tax code on multiple items in MIRO?
Hi all,
I'm entering an invoice using MIRO. The purchase order contains a lot of items for which the tax code is not correct.
I would like to know if there is a way to change the tax code of each item using a mass change function.
If it's not possible in MIRO, is there a way to make the mass change at the purchase order level?
Thank you!Hi,
If that Error will arise maintain the Tax code tab firstly then tick the Calculate tax button.
Ex. As per multiple items tax code problem will arise come back and redo the miro then firstly enter the tax code before the PO number it will update for all the line items.
Regards,
Kanike -
Randomly Generate 0 to 3 Items, Code issue.
In the below code I am trying to generate 0 to 3 items from the Case Select. The code works, mostly, as it will generate and print out 1 item, and I beleave it generates 0 items as it leaves a blank line. However it never generates more then 1 item. Ever.
Any idea's would be helpful on how to fix this please.
' select 0 to 3 traits
b = r.Next(0, 4)
If b > 0 Then
Do Until b = 0
n9 = r.Next(1, 76) ' one roll, full range
Select Case n9
Case 1 To 10
n10 = r.Next(1, 7)
Select Case n10
Case 1
Physiology2 = "Additional atmosphere nativity - Acidic atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
Case 2
Physiology2 = "Additional atmosphere nativity - Sulfurous atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
Case 3
Physiology2 = "Additional atmosphere nativity - Normal atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
Case 4
Physiology2 = "Additional atmosphere nativity - Methane atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
Case 5
Physiology2 = "Additional atmosphere nativity - Hydrogen atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
Case 6
Physiology2 = "Additional atmosphere nativity - Vacuum atmosphere (3 AP, One additional atmosphere type is treated as native per 3 AP spent over the most costly base value included; zero pressure must also be native for Vacuum type; at least low pressure must be native for any other atmosphere type nativity.)"
AP = AP + 3
b = b - 1
End Select
Case 11 To 30
n11 = r.Next(1, 25)
Select Case n11
Case 1
Physiology2 = "Environment intolerance - Acidic atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 2
Physiology2 = "Environment intolerance - Sulfurous atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 3
Physiology2 = "Environment intolerance - Normal atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 4
Physiology2 = "Environment intolerance - Methane atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 5
Physiology2 = "Environment intolerance - Hydrogen atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 6
Physiology2 = "Environment intolerance - Vacuum atmosphere (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 7
Physiology2 = "Environment intolerance - Plutonian climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 8
Physiology2 = "Environment intolerance - Freezing climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 9
Physiology2 = "Environment intolerance - Cold climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 10
Physiology2 = "Environment intolerance - Normal climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 11
Physiology2 = "Environment intolerance - Desert climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 12
Physiology2 = "Environment intolerance - Hot climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 13
Physiology2 = "Environment intolerance - Venusian climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 14
Physiology2 = "Environment intolerance - Molten climate (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 15
Physiology2 = "Environment intolerance - Zero gravity (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 16
Physiology2 = "Environment intolerance - Low gravity (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 17
Physiology2 = "Environment intolerance - Normal gravity (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 18
Physiology2 = "Environment intolerance - High gravity (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 19
Physiology2 = "Environment intolerance - Jovian gravity (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 20
Physiology2 = "Environment intolerance - No atmospheric pressure (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 21
Physiology2 = "Environment intolerance - Thin atmospheric pressure (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 22
Physiology2 = "Environment intolerance - Normal atmosphere pressure (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 23
Physiology2 = "Environment intolerance - Thick atmospheric pressure (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
Case 24
Physiology2 = "Environment intolerance - Jovian atmospheric pressure (-1 AP, One environment class (e.g., jovian gravity) simply cannot be colonized by the species at all. Except in the case of atmosphere types, if several environments of a given parameter are disallowed, all those more extreme in a given direction must be as well. For example, any species that is high g intolerant must be either jovian g intolerant as well or zero through high g intolerant.)"
AP = AP - 1
b = b - 1
End Select
Case 31 To 40
n12 = r.Next(1, 9)
Select Case n12
Case 1
Physiology2 = "Extended temperature tolerance - Plutonian climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 2
Physiology2 = "Extended temperature tolerance - Freezing climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 3
Physiology2 = "Extended temperature tolerance - Cold climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 4
Physiology2 = "Extended temperature tolerance - Normal climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 5
Physiology2 = "Extended temperature tolerance - Desert climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 6
Physiology2 = "Extended temperature tolerance - Hot climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 7
Physiology2 = "Extended temperature tolerance - Venusian climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 8
Physiology2 = "Extended temperature tolerance - Molten climate (One adjacent temperature value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
End Select
Case 41 To 50
n13 = r.Next(1, 6)
Select Case n13
Case 1
Physiology2 = "Extended gravity tolerance - Zero gravity (One adjacent gravity value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 2
Physiology2 = "Extended gravity tolerance - Low gravity (One adjacent gravity value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 3
Physiology2 = "Extended gravity tolerance - Normal gravity (One adjacent gravity value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 4
Physiology2 = "Extended gravity tolerance - High gravity (One adjacent gravity value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
Case 5
Physiology2 = "Extended gravity tolerance - Jovian gravity (One adjacent gravity value is treated as native per 2 AP spent over the most costly base value included.)"
AP = AP + 2
b = b - 1
End Select
Case 51 To 60
n14 = r.Next(1, 6)
Select Case n14
Case 1
Physiology2 = "Extended pressure tolerance - No atmospheric pressure (One adjacent pressure value is treated as native per 2 AP spent over the most costly base value included; Vacuum atmosphere type must be native in order to extend tolerance to zero pressure.)"
AP = AP + 2
b = b - 1
Case 2
Physiology2 = "Extended pressure tolerance - Thin atmospheric pressure (One adjacent pressure value is treated as native per 2 AP spent over the most costly base value included; Vacuum atmosphere type must be native in order to extend tolerance to zero pressure.)"
AP = AP + 2
b = b - 1
Case 3
Physiology2 = "Extended pressure tolerance - Normal atmosphere pressure (One adjacent pressure value is treated as native per 2 AP spent over the most costly base value included; Vacuum atmosphere type must be native in order to extend tolerance to zero pressure.)"
AP = AP + 2
b = b - 1
Case 4
Physiology2 = "Extended pressure tolerance - Thick atmospheric pressure (One adjacent pressure value is treated as native per 2 AP spent over the most costly base value included; Vacuum atmosphere type must be native in order to extend tolerance to zero pressure.)"
AP = AP + 2
b = b - 1
Case 5
Physiology2 = "Extended pressure tolerance - Jovian atmospheric pressure (One adjacent pressure value is treated as native per 2 AP spent over the most costly base value included; Vacuum atmosphere type must be native in order to extend tolerance to zero pressure.)"
AP = AP + 2
b = b - 1
End Select
Case 61 To 65
Physiology2 = "Radical metabolism (-10 AP, 50% of otherwise habitable worlds count as uninhabitable Class Z worlds instead)"
AP = AP - 10
b = b - 1
Case 66 To 75
Physiology2 = "Worse natives (-2 AP per level, Raises the colonization multiplier by one class per level.)"
AP = AP - 2
b = b - 1
End Select
Loop
End If
PrintLine(1, " " & Physiology2)Kyper,
The following *might* do what you want. I'm not sure that I'm interpreting exactly what you want but hopefully this will do it.
I took a handful of those "traits" you showed and put them into a text file (if this is what you want then do the same with all of them). I uploaded the text file so that you can
have a look at it here.
The code follows:
Option Strict On
Option Explicit On
Option Infer Off
Imports System.IO.Path
Public Class Form1
Private rand As New Random
Private traitsList As New List(Of Traits)
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim desktop As String = _
My.Computer.FileSystem.SpecialDirectories.Desktop
Dim traitsTextFilePath As String = _
Combine(desktop, "Traits_Data.txt")
Traits.ReadFromFile(traitsList, traitsTextFilePath)
Dim result As String = GetRandomTraits()
MessageBox.Show(result, "Random Selection")
Stop
End Sub
Private Function GetRandomTraits() As String
Dim retVal As String = Nothing
If traitsList.Count > 0 Then
Dim tempList As New List(Of Traits)
Dim randomSelection As Integer = rand.Next(0, 4)
Select Case randomSelection
Case 0
retVal = String.Empty
Case 1
Dim t As Traits = traitsList(rand.Next(0, traitsList.Count))
retVal = t.Text
Case 2
Do Until tempList.Count = 2
Dim t As Traits = traitsList(rand.Next(0, traitsList.Count))
Do
Dim qry As System.Collections.Generic.IEnumerable(Of Traits) = _
From trait As Traits In tempList _
Where trait.ID = t.ID
If qry IsNot Nothing AndAlso qry.Count = 0 Then
tempList.Add(t)
Exit Do
Else
t = traitsList(rand.Next(0, traitsList.Count))
End If
Loop
Loop
Case 3
Do Until tempList.Count = 3
Dim t As Traits = traitsList(rand.Next(0, traitsList.Count))
Do
Dim qry As System.Collections.Generic.IEnumerable(Of Traits) = _
From trait As Traits In tempList _
Where trait.ID = t.ID
If qry IsNot Nothing AndAlso qry.Count = 0 Then
tempList.Add(t)
Exit Do
Else
t = traitsList(rand.Next(0, traitsList.Count))
End If
Loop
Loop
End Select
If retVal Is Nothing AndAlso tempList.Count > 0 Then
Dim sb As New System.Text.StringBuilder
For i As Integer = 0 To tempList.Count - 1
sb.AppendLine(tempList(i).Text)
If i < tempList.Count - 1 Then
sb.AppendLine()
End If
Next
If sb.Length > 0 Then
retVal = sb.ToString
End If
End If
End If
Return retVal
End Function
End Class
Public Class Traits
Private _iD As Integer
Private _text As String
Private Sub New(ByVal id As Integer, _
ByVal text As String)
_iD = id
_text = text.Trim
End Sub
Public ReadOnly Property ID As Integer
Get
Return _iD
End Get
End Property
Public ReadOnly Property Text As String
Get
Return _text
End Get
End Property
Public Shared Sub ReadFromFile(ByRef traitsList As List(Of Traits), _
ByVal filePath As String)
Try
If traitsList Is Nothing Then
Throw New ArgumentNullException("The collection of Traits cannot be null.")
ElseIf Not My.Computer.FileSystem.FileExists(filePath) Then
Throw New IO.FileNotFoundException("The file path could not be located.")
Else
With traitsList
.Clear()
.TrimExcess()
Dim counter As Integer = 0
Using rdr As New System.IO.StreamReader(filePath)
Do While rdr.Peek() >= 0
Dim itm As String = rdr.ReadLine.Trim
If itm.Length > 0 Then
Dim findDuplicate As System.Collections.Generic.IEnumerable(Of Traits) = _
From t As Traits In traitsList _
Where t.Text.ToLower.Replace(" "c, "") = _
itm.ToLower.Replace(" "c, "")
If findDuplicate.Count = 0 Then
counter += 1
traitsList.Add(New Traits(counter, itm))
End If
End If
Loop
End Using
End With
End If
Catch ex As Exception
Throw
End Try
End Sub
End Class
You can see that the purpose of the class is really just to read that text file - then test that it's not a duplicate and if not, add it to the list which you pass in. Then, back in Form1, the rest is done using that list. The results are shown below:
If that's not what you're trying to do then please explain it better?
Still lost in code, just at a little higher level. -
How to create production order for multiple items having common raw materia
Dear all,
We are running a sheet metal fabrication company at Vadodara Gujrat.
Please guide us how to create single production order for multiple items using single raw material??
For example, We want to produce baby shirt(item code AAA001), shirt with full sleeve(item code AAA002), shirt with half sleeve(item code AAA003),shirt slim fit (item code AAA004),shirt loose fit(item code AAA005) from single raw material say(item code XXX001).
Right now we have to create 5 production order to produce above 5 items of single sales order in SAP B1 though it is made from single raw material which is foolishness and time consuming too. (Please also note that to produce any finfish good item, raw material required for that item may vary every time in our process.)
Kindly guide us how to solve the problem.
Thanks.
RUPESH +91-9227744273
WEB : www.gorasia.co.inHi Rupesh Gorashiya,
This is possible through MRP for that you have to put Sales Order first and Run MRP Wizard
MRP Wizard Put Multi Production Order as per Item Taking in Sales Order just click it on and execute.
Thanks,
Srujal Patel -
Item Renderers Preview and JavaScript Generator wizard
Hi all,
there are 2 feature I can't seem to get my hand on on the
latest Beta release of FB3 (Beta 3): Item Renderers Preview and
JavaScript Generator wizard.
Can anyone elaborate on how to get these started? how can I
check'em out? are they in the Beta 3 at all or are they supposed to
come out only in the final release. As far as now I wasn't able to
find any information on both on the web aside from what Matt Chotin
wrote on the "What's new" and on the FB3 Wiki.
cheers.Hello Heike,
Well I have been working on this and wanted some more information regarding one of the possible issues.
As I have been telling you that I have dropdown boxes and based on the values that the user selects corresponding report should run.(I have eight drop down box and five push buttons)
Now I have made the selection in the drop down boxes "multiple".
I am generating the url for all the selected values. Like I have a drop down box whose value is 0SALES_OFF. if the user selects three options for this filter say "A", "B" and "C" and hits one of the push buttons , the query runs fine and filters the value. The only problem lies in the drop down box: it shows "A","B" and "C" as selected values in the drop down box, however this is just a display text and its value is"!unchanged". Now if the user wants to keep the same filter value the value that is being used for the selection is "!unchanged" instead of "A","B" and "C".
I think this code is generated by SAP.Can you give me some insight as to where should I make certain changes so that values persists?
Personally, I feel this is a more cumbersome method than using the standard navigation block..but still .I am client site...
Thanks and Regards
Pradeep Bhojak -
How do we do production orders for same item code in different sizes
Hi,
We have Items which we buy as a single sheet of material and our customers can ask for us to cut the complete sheet into different sizes before despatching it. i.e
Item Code Sheet1: Sheet size 100mm x 100mm
Customer asks for sheet to be cut into 10 off 10mm x 10mm sheets, which we presently put on the sales order as a line note
We then generate a production order for this item and indicate on the production order printout the line note
We've recently had a customer who has asked for Item 1 in two different sizes on the same sales order ie
Order Line 1 Sheet1 Qty:1 Line note: cut into 10mm x 10mm sheets
Order Line 2 Sheet1 Qty:1 Line note: cut into 50mm x 50mm sheets
When generating the Production order SAP combines the items into
Product No: Sheet1
Planned Qty: 2
Where as we want it to create 2 production orders 1 of each different sizes items.
I know I can create BOMs for those two sizes, but customers can ask for the sheets to be cut to whatever size they want. Is the best method to create BOMs on the fly for each different sizing option or are there alternative methods that are easier to manage ?
Thanks
CarlHi Carl Rutter,
You have to creat 2 special production order for this item. when issue the component make sure you issue the stock as per the cosumption becaue one have 10mmx10mm and the another item have 50x50 in this case you issue component by square inch wise. for example 10*10 = 100 squre inch.
50*50 = 2500 square inch so the cost will be approtionate. you can Use multiple uom method to obtain this, other wise you have covert into stock then you issue the component. If you want traxk size wise ,you can use batch option for Finishe goods.
Regards
Sridharan -
Central Purchase Org and Multiple co codes
Hello everyone,
We are working in SRM 5.0 classic deployment and PDP scenario. We have an issue. We have central purchase org and multiple co codes. So one purchase org will be responsible for all the co codes. In the backend system, pur org is not assigned to any co code since it is a central pur org. Now in SRM , we created a root org, under the root org we created different companies and at the same level i.e under root- purchase org is created and then purchsae groups. In attribute BUK of purchase org, all co codes are assigned. When we check BBP_ATTR_CHECK for this purchase org, we get an error- "company cannot be determined. So we'll not be able to shop. Please let me know if anyone has ever worked on this scenario and whatz the solution? Suitable points will be awarded for the useful answers. Thanks in advance.
Regards
KapilI would not suggest this as an approach. First question is what kind of accounting reports do they need on plant level? Is it AR/AP items per plant or complete set of financial reports include BS and P&L statement.
WERKS field exists in BSEG, so I guess some report can be generated to represent open items on this level.
But if you need deeper division in the company on this level, then segments or business areas should be used.
regards -
MULTIPLE ITEM PROBLEM IN VL31N BDC
hI FRIENDS ,
I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
CODE IS AS FOLLOWS:.........
FUNCTION y_synie_bdcinbdly.
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(EXTNID) LIKE MAKT-MAKTG
*" VALUE(VENDORNO) LIKE LFA1-LIFNR
*" VALUE(PONUMBER) LIKE EKKO-EBELN
*" VALUE(ITEMNUMBER) LIKE LIPS-VGPOS
*" VALUE(MATERIAL) LIKE MAKT-MAKTG
*" VALUE(DLYQTY) LIKE LIPS-LFIMG
*" VALUE(BTCHNO) LIKE LIPS-CHARG
*" VALUE(POSLR) LIKE EKES-EBELP OPTIONAL
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" VALUE(INDELYNO) LIKE SY-MSGV2
*" VALUE(MSG1) LIKE SY-MSGV1
*" VALUE(MSG2) LIKE SY-MSGV2
*" VALUE(MSG3) LIKE SY-MSGV3
*" VALUE(MSG4) LIKE SY-MSGV4
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL
*" ERRTAB STRUCTURE YSYNERRMSGS
*" INDLYTAB STRUCTURE YSYN_QTYTAB
Updated by ANAND SYNISE 19.1.2007
DATA: BEGIN OF bdctab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
DATA: datenow(10) TYPE c,
fldvar(30) TYPE c,
fldno TYPE i,
flditoc(6) TYPE c,
qty(13) TYPE c.
DATA maxposnr LIKE lips-posnr.
DATA testposnr TYPE posnr.
DATA itemnoint TYPE i.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
CLEAR bdctab.
REFRESH bdctab.
PERFORM open_group USING group user keep holddate ctu.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '4007'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-VERUR_LA'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-LIFNR'.
bdctab-fval = vendorno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LV50C-BSTNR'.
bdctab-fval = ponumber.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-VERUR_LA'.
bdctab-fval = extnid.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=MKAL_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIKP-BLDAT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POPO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '0111'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-PO_MATNR'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = 'WEIT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-PO_MATNR'.
bdctab-fval = material.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POLO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
*ADDED BY ANAND ON 22-01-2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = ITEMNUMBER . "ITEMNUMBER = LIPS-VGPOS
APPEND bdctab.
************ENDED***********************
ADDED BY MILIND 19.01.2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = poslr .
APPEND bdctab.
* ENDED * *
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
bdctab-fval = ''.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-CHARG(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
QTY = INDLYTAB-DLYQTY.
qty = dlyqty.
bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
bdctab-fval = QTY.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIPS-CHARG(01)'.
* BDCTAB-FVAL = INDLYTAB-BTCHNO.
bdctab-fval = btchno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=SICH_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-MATNR(02)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CALL TRANSACTION 'VL31N' USING bdctab MODE 'N' MESSAGES INTO messtab.
subrc = sy-subrc.
PERFORM close_group USING ctu.
CLEAR bdctab.
REFRESH bdctab.
IF sy-subrc EQ 0.
indelyno = sy-msgv2.
ENDIF.
LOOP AT messtab.
MOVE: messtab-msgid TO errtab-msgid,
messtab-msgnr TO errtab-msgnr,
messtab-msgv1 TO errtab-msg1,
messtab-msgv2 TO errtab-msg2,
messtab-msgv3 TO errtab-msg3,
messtab-msgv4 TO errtab-msg4.
APPEND ERRtab.
ENDLOOP.
LOOP AT errtab.
SELECT SINGLE text FROM t100
INTO errtab-errmsg
WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
AND sprsl EQ sy-langu.
MODIFY errtab.
ENDLOOP.
ENDFUNCTION.Hi,
Check this code:
REPORT Z_CUSTOMER_UPLOAD .
D A T A D E C L A R A T I O N S *
DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_CUSTOMER.
DATA:BEGIN OF IT_success OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_success.
DATA:BEGIN OF IT_error OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_error.
DATA: L_INDEX TYPE SY-TABIX.
DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
ERROR MESSAGE TABLE
DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : C_S TYPE C VALUE 'S',
C_E TYPE C VALUE 'E'.
*DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
IT_ERROR LIKE IT_CUSTOMER OCCURS 0.
DATA : V_RECTOT TYPE I,
V_RECERR TYPE I,
V_RECSUC TYPE I.
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_FILE LIKE RLGRAP-FILENAME .
SELECTION-SCREEN : END OF BLOCK B1.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
to get F4 help for p_file
PERFORM F4_FILENAME USING P_FILE.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Uploading data from flat file into it_tab
PERFORM BDC_UPLOAD USING P_FILE.
PERFORM PROCESS_DATA.
PERFORM POPULATE_BDC.
E N D O F S E L E C T I O N *
*END-OF-SELECTION.
PERFORM DISPLAY_REPORT.
*& Form F4_FILENAME
text
-->P_P_FILE text
FORM F4_FILENAME USING P_P_FILE.
DATA:L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE .
P_P_FILE = L_FILE.
ENDFORM. " F4_FILENAME
*& Form BDC_UPLOAD
text
-->P_P_FILE text
FORM BDC_UPLOAD USING P_P_FILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 8
I_END_ROW = 1000
TABLES
INTERN = IT_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
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. " BDC_UPLOAD
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA.
SORT IT_DATA BY ROW COL.
LOOP AT IT_DATA.
CASE IT_DATA-COL.
WHEN 1.
IT_CUSTOMER-KUNNR = IT_DATA-VALUE.
WHEN 2.
IT_CUSTOMER-VKORG = IT_DATA-VALUE.
WHEN 3.
IT_CUSTOMER-VTWEG = IT_DATA-VALUE.
WHEN 4.
IT_CUSTOMER-MATNR = IT_DATA-VALUE.
WHEN 5.
IT_CUSTOMER-KDMAT = IT_DATA-VALUE.
WHEN 6.
IT_CUSTOMER-MEGRU = IT_DATA-VALUE.
WHEN 7.
IT_CUSTOMER-LPRIO = IT_DATA-VALUE.
WHEN 8.
IT_CUSTOMER-ANTLF = IT_DATA-VALUE.
APPEND IT_CUSTOMER.
ENDCASE.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form POPULATE_BDC
text
--> p1 text
<-- p2 text
FORM POPULATE_BDC.
DATA:L_COUNTER TYPE N,
L_STRING TYPE STRING.
LOOP AT IT_CUSTOMER.
AT NEW KUNNR.
CLEAR L_COUNTER.
L_INDEX = SY-TABIX.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_dynpro using 'SAPMV10A' '0100'.
perform bdc_field using 'MV10A-KUNNR'
IT_CUSTOMER-KUNNR.
perform bdc_field using 'MV10A-VKORG'
IT_CUSTOMER-VKORG.
perform bdc_field using 'MV10A-VTWEG'
IT_CUSTOMER-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'/00'.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MATNR.
CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-KDMAT.
CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MEGRU.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*-- For Page down in Call Transaction Mode
IF L_COUNTER = 14.
CLEAR L_COUNTER.
PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-SELKZ.
perform bdc_field using 'BDC_OKCODE'
'=SELE'.
perform bdc_dynpro using 'SAPMV10A' '0300'.
perform bdc_field using 'MV10A-KDMAT'
IT_CUSTOMER-KDMAT.
perform bdc_field using 'MV10A-LPRIO'
IT_CUSTOMER-LPRIO.
perform bdc_field using 'MV10A-ANTLF'
IT_CUSTOMER-ANTLF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'.
at end of kunnr.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
CLEAR IT_BDC.
REFRESH IT_BDC.
ENDAT.
IF NOT IT_MESSAGES[] IS INITIAL.
PERFORM FORMAT_MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. " POPULATE_BDC
*& Form bdc_dynpro
text
-->P_0273 text
-->P_0274 text
FORM bdc_dynpro USING VALUE(P_0273)
VALUE(P_0274).
IT_BDC-PROGRAM = P_0273.
IT_BDC-DYNPRO = P_0274.
IT_BDC-DYNBEGIN = 'X'.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0278 text
-->P_RECORD_KUNNR_001 text
FORM bdc_field USING VALUE(P_0278)
VALUE(P_0279).
IT_BDC-FNAM = P_0278.
IT_BDC-FVAL = P_0279.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_field
*& Form FORMAT_MESSAGE
text
--> p1 text
<-- p2 text
FORM FORMAT_MESSAGE.
DATA: L_MSG(100).
LOOP AT IT_MESSAGES.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGES-MSGID
LANG = SY-LANGU
NO = IT_MESSAGES-MSGNR
V1 = IT_MESSAGES-MSGV1
V2 = IT_MESSAGES-MSGV2
V3 = IT_MESSAGES-MSGV3
V4 = IT_MESSAGES-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 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.
write:/ l_msg.
ENDLOOP.
ENDFORM. " FORMAT_MESSAGE
reward if helpful,
keerthi
Maybe you are looking for
-
Help Transfering Music Videos from Mac To PC
Hi everyone! We have a Mac and a PC at home, both with iTunes. I'm trying to transfer music videos from my Mac to the PC. Both computers are authorized. I'm copying the music videos to an external hard drive from the Mac. After connecting the drive t
-
So recently today my iPhone 4 which is running on 6.1.3 has been saying "Storage Almost Full." I am not sure what this means because I have literally deleated tons of stuff on my iPhone. I have a good 3.61 GB free space. Every 5 minutes it pops up sa
-
How can I transfer Word documents om my Windows PC to my iPad?
I have tried to send Word documents, music and photos from my Windows 7 PC to my iPad mini to no avail. The iPad is turned on, the sync cable is attached. I have been rght clicking the file, then 'send to' my iPad. What am I doing wrong?
-
Internet Exployer has stopped working
It seemes my computer updated to windows 8.1 automatically and now I keep getting a message that "Internet Exployer has Stopped Working" ----How do I fix this problem??
-
UWL / Delta Pull Configuration
Hello, I am trying to configured delta pull in UWL, but when I create a new SYstem in UWL administration, I get the message: Could not verify if the backend of system WADCLNT200 is configured for optimized delta pull. I need to implement delta pull b