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

function help

Former Member
0 Likes
572

hi Friends,

I am creating a report.

How to use this function " GET_SERNOS_OF_DOCUMENT "

Please help me with example.

Thanks

Rahul s.

2 REPLIES 2
Read only

Former Member
0 Likes
440

hi,

Text

Identifying serial numbers for the workforce

Functionality

The function module provides the calling program, including the serial numbers Equipment numbers, an SAP object, even if the object affected list is not already on the database, but only in global memory function group exists.

The SAP objects are

Supplies

Customer orders

Material evidence

Inspection

Construction contracts

Example

Notes

Further information

Parameters

KEY_DATA

STATUS_PRE_READ

SERNOS

SERXX

Exceptions

KEY_PARAMETER_ERROR

NO_DATA_FOUND

NO_SUPPORTED_ACCESS



*&---------------------------------------------------------------------*
*& Form GET_ITEM_SERIALS
*&---------------------------------------------------------------------*
* This routine give back the serialnumbers of salesdocument *
* position. The numbers are processed as print-lines in the *
* table KOMSER_PRINT. *
*----------------------------------------------------------------------*
* --> US_VBELN Salesdocument
* --> US_POSNR Position of the salesdocument
*----------------------------------------------------------------------*
FORM GET_ITEM_SERIALS.
DATA: KEY_DATA LIKE RSEROB,
SERNOS LIKE RSEROB OCCURS 0 WITH HEADER LINE.
KEY_DATA-TASER = 'SER02'.
KEY_DATA-SDAUFNR = VBDKA-VBELN.
KEY_DATA-POSNR = VBDPA-POSNR.
IF KEY_DATA-SDAUFNR IS INITIAL AND NOT
KEY_DATA-POSNR IS INITIAL.
* beim Anlegen ist Belegnummer leer - deshalb Dummy-Belegnummer
KEY_DATA-SDAUFNR = CHAR$.
ENDIF.
* Read the Serialnumbers of a Position.
REFRESH: TKOMSER,
TKOMSER_PRINT.

CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'
EXPORTING
KEY_DATA = KEY_DATA
TABLES
SERNOS = SERNOS
EXCEPTIONS
KEY_PARAMETER_ERROR = 1
NO_SUPPORTED_ACCESS = 2
NO_DATA_FOUND = 3
OTHERS = 4.
IF SY-SUBRC NE 0 AND
SY-SUBRC NE 3.
PERFORM PROTOCOL_UPDATE.
ENDIF.
CHECK SY-SUBRC EQ 0.
* Serialnummern übergeben
TKOMSER-VBELN = SERNOS-SDAUFNR.
TKOMSER-POSNR = SERNOS-POSNR.
LOOP AT SERNOS.
TKOMSER-SERNR = SERNOS-SERNR.
APPEND TKOMSER.
ENDLOOP.
* Process the stringtable for Printing.
CALL FUNCTION 'PROCESS_SERIALS_FOR_PRINT'
EXPORTING
50 Technical Note
Sample Programs
Sample Program YRVADOR01 (Example 1)
I_BOUNDARY_LEFT = '(_'
I_BOUNDARY_RIGHT = '_)'
I_SEP_CHAR_STRINGS = ',_'
I_SEP_CHAR_INTERVAL = '_-_'
I_USE_INTERVAL = 'X'
I_BOUNDARY_METHOD = 'C'
I_LINE_LENGTH = 50
I_NO_ZERO = 'X'
I_ALPHABET = SY-ABCDE
I_DIGITS = '0123456789'
I_SPECIAL_CHARS = '-'
I_WITH_SECOND_DIGIT = ' '
TABLES
SERIALS = TKOMSER
SERIALS_PRINT = TKOMSER_PRINT
EXCEPTIONS
BOUNDARY_MISSING = 01
INTERVAL_SEPARATION_MISSING = 02
LENGTH_TO_SMALL = 03
INTERNAL_ERROR = 04
WRONG_METHOD = 05
WRONG_SERIAL = 06
TWO_EQUAL_SERIALS = 07
SERIAL_WITH_WRONG_CHAR = 08
SERIAL_SEPARATION_MISSING = 09.
IF SY-SUBRC NE 0.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDFORM. " GET_ITEM_SERIALS
*eject


Hope this helps, Do reward.

Edited by: Runal Singh on Apr 3, 2008 2:32 PM

Read only

Former Member
0 Likes
440

have a look at the samle code

  • Read the Serialnumbers of a Position.

REFRESH: TKOMSER,

TKOMSER_PRINT.

CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'

EXPORTING

KEY_DATA = KEY_DATA

TABLES

SERNOS = SERNOS

EXCEPTIONS

KEY_PARAMETER_ERROR = 1

NO_SUPPORTED_ACCESS = 2

NO_DATA_FOUND = 3

OTHERS = 4.

IF SY-SUBRC NE 0 AND

SY-SUBRC NE 3.

PERFORM PROTOCOL_UPDATE.

ENDIF.

CHECK SY-SUBRC EQ 0.

for detailed information

http://docs.hp.com/en/hpr3_61tn2-v2enUS/hpr3_61tn2enUS.pdf

follow the link

Do reward if helpful