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

Add serial numbers in sales document

Former Member
0 Likes
8,945

Hi everyone

In case of third-party businnes we use the workflow sales order -> purchase order -> invoice.

In this case we have to add the serial numbers in the sales document under Extras->Technical Objects.

Is there any function or bapi that I can use???

PS:

I've try the combination:

SERNR_ADD_TO_AU and

IWOL_WV_ADD_OBJECTS but is not working since the second function expects to have an equipment with the material nr and the serial nr that I try to add ( and this equipment is not existing yet ).

Thanks.

Anca

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,374

Hi,

Have you tried function modules SERIALPROFILE_CHECK, SERNR_ADD_TO_DOCUMENT or SERNR_MAINTAIN_IN_DOCUMENT?

Also check the function modules in table T377X for Serial Procedures related to SD (e.g. SDAP is for "Post serial numbers for SD order" and may have function module SERIAL_LISTE_POST_AU as its form value).

By the way, in VA02 the function for Extras -> Technical Objects branches to include program MV45AF0F_FCODE_POTO, form FCODE_POTO. Investigating or debugging this logic may provide you some clues if none of the functions suggested above are of use.

Best Regards,

James Gaddis

12 REPLIES 12
Read only

Former Member
0 Likes
5,375

Hi,

Have you tried function modules SERIALPROFILE_CHECK, SERNR_ADD_TO_DOCUMENT or SERNR_MAINTAIN_IN_DOCUMENT?

Also check the function modules in table T377X for Serial Procedures related to SD (e.g. SDAP is for "Post serial numbers for SD order" and may have function module SERIAL_LISTE_POST_AU as its form value).

By the way, in VA02 the function for Extras -> Technical Objects branches to include program MV45AF0F_FCODE_POTO, form FCODE_POTO. Investigating or debugging this logic may provide you some clues if none of the functions suggested above are of use.

Best Regards,

James Gaddis

Read only

Former Member
0 Likes
5,374

Hi James

I've tried SERNR_MAINTAIN_IN_DOCUMENT. The function is executed successfully. The ANZSN is ok = 4 ( 3 serials nr I've add manually, 1 with the function ) and SERIAL_COMMIT is X.

But I am not able to see anything in VA03. No new serial nr appears in the technical objects. And if I am trying once again with the same serial nr I am receiving the message: "Serial number SERIALNRTEST1 already assigned"

I think I am missing something. I will check the VA02 to see how it is there beeing done.

Thank's.

Anca

Read only

Former Member
0 Likes
5,374

Hi Anca,

You may try this FM <b>IWOL_WV_ADD_OBJECTS</b>.

Hope this will help.

Regards,

Ferry Lianto

Read only

0 Likes
5,374

Hi Ferry

I've already tried. Is not working.

But thanks anyway.

Anca

Read only

Former Member
0 Likes
5,374

Hi Anca,

Did you assign correct parameters for FM IWOL_WV_ADD_OBJECTS? Especially TO_TYPE = 'SD'.

Please add at the end FM<b>IWOL_WV_POST_OBJECT_LIST</b>.

Hope this will help.

Regards,

Ferry Lianto

Message was edited by: Ferry Lianto

Read only

0 Likes
5,374

Hi Ferry

The parameters I've assign correct. But I allways get the error INVALID_SERIALNR = 4 because the function is searching for an equipment(sernr + matnr) that is not existing at that time.

Regards,

Anca

Read only

0 Likes
5,374

Hi Anca,

did you solved the problem with the function modules

to add serial numbers to material?

At the moment I've the same problem and I need

a solution, as soon as possible.

Thanks in advance

Pascal

Read only

0 Likes
5,374

Hello Pascal,

Did you solved this serial number assignment?

for the movment i also have the same requirement and looking for your help.

I am beginner in ABAP so thanks to help me.

Thanks,

Devasing.

Read only

0 Likes
5,374

Hello Anca,

Did you solved this serial number assignment?

for the movment i also have the same requirement and looking for your help.

I am beginner in ABAP so thanks to help me.

Please give me the steps you followed to solve this problem.

Thanks,

Devasing.

Read only

Former Member
0 Likes
5,374

I must indicate serial number to existing order.

I have tried SERNR_ADD_TO_AU, It does not work because the data in OBJK has field TASER with SER01 or SER03, and we must have SER02 for orders.

Any idea?

Regards,

Yann SZWEC

Read only

0 Likes
5,374

Hi Yann SZWEC,

did you solved the problem with the function modules

to add serial numbers to material?

At the moment I've the same problem and I need

a solution, as soon as possible.

Thanks in advance.

Pascal Schrack

Read only

vinoth_kumar7
Explorer
0 Likes
5,374

Hi,

Use the following code to update SERIAL number in sales order item. It works.

    CALL FUNCTION 'SERNR_ADD_TO_AU'
      EXPORTING
        sernr                 = ls_viqmel-serialnr
        profile               = xvbap-serail
        material              = xvbap-matnr
        quantity              = '1'
        document              = vbak-vbeln
        item                  = xvbap-posnr
        debitor               = vbak-kunnr
        vbtyp                 = vbak-vbtyp
        sd_auart              = vbak-auart
        sd_postyp             = xvbap-pstyv
* IMPORTING
*       ANZSN                 =
*       ZEILEN_ID             =
*       SERIAL_COMMIT         =
      EXCEPTIONS
        konfigurations_error  = 1
        serialnumber_errors   = 2
        serialnumber_warnings = 3
        no_profile_operation  = 4
        OTHERS                = 5.

    CALL FUNCTION 'SERIAL_LISTE_POST_AU'.
    COMMIT WORK AND WAIT.