Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Item material Configuration BAPI_CONTRACT_CREATEFROMDATA

saad_nisar
Explorer
0 Likes
628

Dear Gurus.

I hope you all are doing well.

I'm stuck in material configuration.

i have gone through many forms but couldn't find a proper solution.

please can you tell me how to pass Configuration values so that when the contract is created material characteristics are maintained.

We have following characteristics maintain against material

LENGTH

REELSIZE

DENSITY

CORE_DIA

USAGE

HEAT_SEAL

SURF_TREAT

WET_TENSION

Dim objItemsIn5 As Object 'CONTRACT_CFGS_REFINST Table

Dim objItemsIn6 As Object 'CONTRACT_CFGS_REF Table

Dim objItemsIn7 As Object 'CONTRACT_CFGS_VALUE OF Table

Dim objItemsIn8 As Object 'CONTRACT_CFGS_INST OF Table

Set objItemsIn7 = objBapi_CrtOrder.Tables.Item("CONTRACT_CFGS_VALUE")

objItemsIn7.Rows.Add

Dim itmNr4 As Integer

Dim check4 As String

itmNr4 = 1

For i = 20 To 100

check4 = Sheet3.Cells(i, 7).Value

If check4 <> "" Then

objItemsIn7.Rows.Add

'objItemsIn7.Value(itmNr4, "INST_ID") = "00000001"

objItemsIn7.Value(itmNr4, "CHARC") = "LENGTH"

objItemsIn7.Value(itmNr4, "VALUE") = "2,000.0000 m" 'Sheet3.Cells(i, 8).Value

'objItemsIn7.Value(itmNr4, "VALUE_TO") = "0.0000000000000000E+00" 'Sheet3.Cells(i, 8).Value

objItemsIn7.Value(itmNr4, "VALCODE") = "1"

itmNr4 = itmNr4 + 1

End If

Next i

Set objItemsIn5 = objBapi_CrtOrder.Tables.Item("CONTRACT_CFGS_REFINST")

objItemsIn5.Rows.Add

Dim itmNr2 As Integer

Dim check2 As String

itmNr2 = 1

For i = 20 To 100

check2 = Sheet3.Cells(i, 7).Value

If check2 <> "" Then

objItemsIn5.Rows.Add

objItemsIn5.Value(itmNr2, "POSEX") = Sheet3.Cells(i, 7).Value

objItemsIn5.Value(itmNr2, "CONFIG_ID") = itmNr2

objItemsIn5.Value(itmNr2, "INST_ID") = itmNr2

itmNr2 = itmNr2 + 1

End If

Next i

Set objItemsIn6 = objBapi_CrtOrder.Tables.Item("CONTRACT_CFGS_REF")

objItemsIn6.Rows.Add

Dim itmNr3 As Integer

Dim check3 As String

itmNr3 = 1

For i = 20 To 100

check3 = Sheet3.Cells(i, 7).Value

If check3 <> "" Then

objItemsIn6.Rows.Add

'objItemsIn6.Value(itmNr3, "POSEX") = Sheet3.Cells(i, 7).Value

objItemsIn6.Value(itmNr3, "CONFIG_ID") = itmNr3

objItemsIn6.Value(itmNr3, "ROOT_ID") = "00000001"

objItemsIn6.Value(itmNr3, "COMPLETE") = "T"

objItemsIn6.Value(itmNr3, "CONSISTENT") = "T"

itmNr3 = itmNr3 + 1

End If

Next i

Set objItemsIn8 = objBapi_CrtOrder.Tables.Item("CONTRACT_CFGS_INST")

objItemsIn8.Rows.Add

Dim itmNr5 As Integer

Dim check5 As String

itmNr5 = 1

For i = 20 To 100

check5 = Sheet3.Cells(i, 7).Value

If check5 <> "" Then

objItemsIn8.Rows.Add

objItemsIn8.Value(itmNr5, "INST_ID") = "00000001"

objItemsIn8.Value(itmNr5, "OBJ_TYPE") = "MARA"

objItemsIn8.Value(itmNr5, "CLASS_TYPE") = "300"

objItemsIn8.Value(itmNr5, "OBJ_KEY") = Sheet3.Cells(i, 2).Value  "Material Code

objItemsIn8.Value(itmNr5, "QUANTITY") = Sheet3.Cells(i, 3).Value  "Order Quantity

objItemsIn8.Value(itmNr5, "QUANTITY_UNIT") = "KG"

objItemsIn8.Value(itmNr5, "COMPLETE") = "T"

objItemsIn8.Value(itmNr5, "CONSISTENT") = "T"

itmNr5 = itmNr5 + 1

End If

Next i

Regards

Saad Khatib

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
476
2 REPLIES 2
Read only

Former Member
0 Likes
477
Read only

0 Likes
476

Dear Ryan

Thank you for the quick response.

I'm getting an error Equipment does not exist.

by default VA41 create an equipment no 999999999999990001

still get this message.

Regards

Saad