cancel
Showing results for 
Search instead for 
Did you mean: 

How to create the GoodsTag with serial number using the PDI?

former_member200995
Contributor
0 Kudos

Hi experts,

  • 1、In PDI, we can create the GoodsTag use the below code:

var aa = GoodsTagGenerator.Create();

if(aa.GoodsTagSpecification.Count() > 0 )

{

foreach(var goodtags in aa.GoodsTagSpecification)

{

goodtags.GoodsTagTypeCode = "3";

goodtags.Text=ins_this.ProductDescription;

goodtags.MaterialKey.ProductID.content = ins_this.Product.content;

goodtags.GoodsTagMaterialQuantity.content = 1;

goodtags.GoodsTagMaterialQuantity.unitCode = "EA";

goodtags.IdentifiedStockKey.ID.content=ins_this.BatchCode.content;

goodtags.NextExternalSerialID = "abcdef";

}

}

else

{

var goodtags = aa.GoodsTagSpecification.Create();

if(goodtags.IsSet())

{

goodtags.GoodsTagTypeCode = "3";

goodtags.Text=ins_this.ProductDescription;

goodtags.MaterialKey.ProductID.content = ins_this.Product.content;

goodtags.GoodsTagMaterialQuantity.content = 1;

goodtags.GoodsTagMaterialQuantity.unitCode = "EA";

goodtags.IdentifiedStockKey.ID.content=ins_this.BatchCode.content;

goodtags.NextExternalSerialID = "abcdef";

//Doubtful Code

//goodtags.CreateIndividualMaterials();

//

//foreach(var ser in goodtags.GoodsTagSpecificationIndividualDetails.IndividualMaterial)

//{

//ser.ServiceProcessInformation.SerialID = "12345";

//}

//var ser = goodtags.GoodsTagSpecificationIndividualDetails.Create();

//if(ser.IsSet())

//{

//ser.IndividualMaterial.ParentIndividualProduct. = "12345";

//}

}

}

aa.GenerateGoodsTags();

  • 2、There is external reference in the GoodsTag, but no the serial number, I want to add the serial number using the code, how to do it?
  • 3、In the system BO (GoodsTag,GoodsTagGenerator),node IndividualMaterial can not use the event(create), and I don’t know how to use the function CreateIndividualMaterials()?
  • question: How to create the GoodsTag with serial number using the PDI?

Thanks a lot.

Benny Huang

Accepted Solutions (1)

Accepted Solutions (1)

former_member200995
Contributor
0 Kudos

Using the code:

if(goodtags.GoodsTagSpecificationIndividualDetails.Count() > 0)
{
foreach(var detail in goodtags.GoodsTagSpecificationIndividualDetails)
{
detail.IndividualMaterialSerialID = "6633123456b";

}

}

goodtags.CreateIndividualMaterials();

It is ok for writing the serialID, thanks Rahul and experts.

Best Regards,

Benny

Answers (3)

Answers (3)

former_member296450
Participant

Hello Benny,

Attached code working for different use case (Outbound delivery). You need to change according to your requirement.

BR
Rahul

former_member200995
Contributor
0 Kudos

Hi Rahul,

I understood your case, but in my case, if create the GoodsTag using ABSL, the node aftermodify of SiteLogisticsLot can not touch, and the node SiteLogisticsLot can not be created, so the assignment is not finish. any idea?

BR

Benny Huang

óespinar
Participant
0 Kudos

Hi Rahul,

Could you please give me a PDI sample code for creating GoodsTag (Packages and Product into Packages) within Outbound Deliveries? I did not found any documentation about that...

Thanks and kind regards,

Ó. Espinar

former_member296450
Participant
0 Kudos

Hello Benn,

PFA.15483832611.png

former_member200995
Contributor
0 Kudos

Hi Rahul,

Thanks a lot.

I understand your script. I test in my system.

But my script is from GoodsTagGenerator.create(), I test it can not to aftermidify of SiteLogisticsLot. The key is the link from

GoodsTagGenerator to SiteLogisticsLot, I don't know it, could you help me? Thanks.


Best Regards,

Benny Huang

0 Kudos

Hello Rahul.

Is it possible to create the assigment of serial numbers for material input in the Production Lot?
I want to add Serial Numbers via absl code for batch input material
Regards

former_member296450
Participant
0 Kudos
  • ðDirectly we cannot attach serial no in outbound delivery.

We can attach Next Serial Number field in Post Goods Issue screen comes from following Site Logistics Lot Business Object.

The Node where the Serial Number should be maintained is SerialNumberAssignment Node.

User need to do the following steps as mentioned below:-

1. Write a script on After Modify of Site Logistics Lot , Material Output Node. Material Output Node represents the line item in Post Goods Issue screen.

2. Navigate from MATERIAL_OUTPUT to SERIAL _NUMBER_ASSIGNMENT. BO : SITE_LOGISTICS_LOT Node: MATERIAL_OUTPUT ASSOCIATION : SERIAL _NUMBER_ASSIGNMENT

3.Create the Instance of SerialNumberAssignment Node for each serial number and attribute Fill the SERIALID , MATERIALOUTPUTUUID.

4. Call the Confirm Action on SerialNumberAssignment Node AFTER_MODIFY on MATERIAL_OUTPUT can get called multiple times \

/*

Add your SAP Business ByDesign scripting language implementation for:

Business Object: SiteLogisticsLot

Node: MaterialOutput

Event: AfterModify

Note:

- To access the elements of the business object node,

use path expressions, for example, this.<element name>.

- To use code completion, press CTRL+J.

- The solution uses this script if:

- the value of any field in the node in which this script is contained is modified.

- the node itself is modified by another business object within the same solution.

*/

import ABSL;

//var b = 0;

//if (b == 0)

//{

//if (this.MTest == false)

//{

//if (!this.ConfirmMainInventorySeparatingValues.MaterialKey.ProductID.content.IsInitial())

//{

////var y= this.ConfirmMainInventorySeparatingValues.MaterialKey.ProductID.

//////var iin = SiteLogisticsLot.Retrieve(this.ID);

////var mat = iin.MaterialOutput.GetFirst();

////var instSerial = mat.SerialNumberAssignment.Create();

//

//

//var rt : elementsof SiteLogisticsLot.SerialNumberAssignment;

//rt.SerialID = "9";

//rt.MaterialOutputUUID.content = this.ConfirmMainInventorySeparatingValues.MaterialUUID.content;//"00163e6b75071ed8bcf4a7691f622fee";

//var inst = this.SerialNumberAssignment.Create(rt);

//

//var a = 9;

//b = b + 1;

//this.MTest = true;

//

//}

//}

//}

BR

Rahul

former_member296450
Participant
0 Kudos

eduardogarciag Sorry for late reply ! Did you solve the issue?

former_member296450
Participant
0 Kudos

Hello Benn,

You need to create an instance of "SerialNumberAssignment".

Path is :

GoodsTagGenerator--> GoodsTagSpecification--> SiteLogisticsLot--> MaterialOutput-->SerialNumberAssignment. And assign your serial number.

BR
Rahul

former_member200995
Contributor
0 Kudos

Hi Rahul,

Thanks a lot.

I test with the patch, the SiteLogisticsLot is not set when the GoodsTagSpecification.Create(), and SiteLogisticsLot can't Create, so I can't add a node instance of SiteLogisticsLot, so assign is failure. Maybe I miss some steps?

Are things the same there?

Best Regards,

Benny Huang