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

Issue with Function module FKK_CONTAINER_2_REFUSAL

viral_bhuva
Explorer
0 Likes
788

Hello Experts,

I am trying to convert the correspondence data using the below code for return document:

* get the correspondence data

   CALL FUNCTION 'FKK_READ_CORR'

     EXPORTING

       i_dfkkcoh      = t_dfkkcoh

     TABLES

       t_fkkcoi       = t_fkkcoi

       t_dfkkcod      = t_dfkkcod

       t_dfkkcodclust = t_dfkkcodclust

     EXCEPTIONS

       OTHERS         = 1.

* convert the correspondence data

   CALL FUNCTION 'FKK_CONTAINER_2_REFUSAL'

     EXPORTING

       i_dfkkcoh      = t_dfkkcoh

     IMPORTING

       e_dfkkrk       = e_dfkkrk

       e_dfkkrp       = e_dfkkrp

       e_fkkvk        = e_fkkvk

       e_fkkvkp       = e_fkkvkp

       e_fkkract      = e_fkkract

     TABLES

       t_cfkkop       = t_cfkkop

       t_zfkkop       = t_zfkkop

       t_fkkcoi       = t_fkkcoi

       t_dfkkcod      = t_dfkkcod

       t_dfkkcodclust = t_dfkkcodclust

     EXCEPTIONS

       OTHERS         = 1.


I have checked the data in table dfkkcodclust. data exists in this table but the FM is failing to import data, so returns empty table T_CFKKOP.

The below code does not import the data:

CASE h_version.

     WHEN OTHERS.

       CATCH SYSTEM-EXCEPTIONS conne_import_wrong_comp_type = 8

                               conne_import_wrong_comp_leng = 9

                               OTHERS = 1.

         IMPORT

           t_cfkkop TO t_cfkkop

           t_zfkkop TO t_zfkkop

           dfkkrk   TO c_dfkkrk

           dfkkrp   TO c_dfkkrp

           fkkvk    TO c_fkkvk

           fkkvkp   TO c_fkkvkp

           fkkract  TO c_fkkract

         FROM DATABASE dfkkcodclust(co)

         ID h_cokey.

       ENDCATCH.

       IF sy-subrc = 8 OR sy-subrc = 9 OR sy-subrc = 1.

         MESSAGE ID '>6' TYPE 'E' NUMBER '002'.

         sy-subrc = 0.

       ENDIF.

   ENDCASE.



This is happening for some return documents only.

2 REPLIES 2
Read only

Private_Member_7726
Active Contributor
0 Likes
718

Hi,

Yes, it's a nasty and known "feature" - after the change of underlying DDIC Structures used to export the data, correspondence containers can not be imported by the SAP Standard logic anymore... See Note 1694243 - COTYP 0001: Printing after structural change, for example.

The only way of rescuing those correspondences I can think of borders on being impossible, unless the structure changes resulted from addition of relatively few custom fields... You'd have to somehow figure out what the types and structures were like at the time correspondences were created, recreate (in DDIC) those types, successfully import the containers using custom logic into old types/structures, move-corresponding to the new types/structures and export containers again... Tedious enough, even if you have a way to figure out the structure changes.

cheers

Janis

Read only

0 Likes
718

Hell Janis,

Thanks for your help!

Here, what I have observed that for some of the COKEY (for COTYP = 0001) I am getting output and for some I am not getting. Before the change structure FKKOP it was the same situation.

With Regards,

Viral