Skip to Content
author's profile photo Former Member
Former Member

Duplicate records in start routine

Hi,

I'M trying to duplicate records from source_package in start routine to duplicate records

I'm facing an issue to save the new created records in source package

DATA : SOURCE_PACKAGE_2 TYPE tyt_sc_1.

DATA : it_zco_ord TYPE TABLE OF /bic/pzco_ord.

DATA : t_zco_ord TYPE /bic/pzco_ord.

DATA : wa_ligne TYPE tys_sc_1.

DELETE SOURCE_PACKAGE WHERE /bic/zres_0002 IS INITIAL.

DELETE SOURCE_PACKAGE WHERE /bic/zres_0004 IS INITIAL.

  • Transformation

SOURCE_PACKAGE_2[] = SOURCE_PACKAGE[].

REFRESH SOURCE_PACKAGE.

  • *****

LOOP AT SOURCE_PACKAGE_2 ASSIGNING <source_fields>.

REFRESH it_zco_ord.

SELECT * FROM /bic/pzco_ord INTO TABLE it_zco_ord

WHERE objvers = 'A'

AND /bic/zc_propri = <source_fields>-/bic/zc_propri

AND /bic/zc_struct = <source_fields>-/bic/zc_struct

AND /bic/zc_typede = <source_fields>-/bic/zc_typede

.

IF sy-subrc = 0.

LOOP AT it_zco_ord INTO t_zco_ord.

append <source_fields> to SOURCE_PACKAGE.

ENDLOOP.

ENDIF.

ENDLOOP.

the all created records at not available in Final routine

do you have any idea

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 06:59 PM

    Have you tried simulatin/debugging. What value are you getting in SOURCE_PACKAGE after the execution of your code?

    Regs

    VJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08:00 PM

    Hi

    Try this:==============================================

    DATA: wa_temp TYPE DATA_PACKAGE_STRUCTURE OCCURS 0 WITH HEADER LINE.

    LOOP AT DATA_PACKAGE INTO wa_temp.

    • Assign here new data to your char or a KF

    wa_temp-/BIC/YourIO = …

    APPEND wa_temp.

    ENDLOOP.

    LOOP AT wa_temp.

    APPEND wa_temp TO DATA_PACKAGE.

    ENDLOOP.

    or this==============================================

    DATA: wa_temp TYPE DATA_PACKAGE_STRUCTURE OCCURS 0 WITH HEADER LINE.

    wa_temp[] = data_package[].

    LOOP AT wa_temp.

    wa_temp-/BIC/YourIO = "My Value".

    modify wa_temp.

    ENDLOOP.

    append lines of wa_temp to data_package.

    =====================================================

    Regards

    PWnuk

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 02:25 PM

    Thank You Guys,

    I'Ve done only one routine in End routine, it works fine

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.