Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to make two tables mutually convertiable

Hi experts,

I am faceing a problem while doing a program, in which i used CSAP_MAT_BOM_READ FM and getting the values in table i_stp1 having structure STPO_API02 and declared another internal table i_stp

begin of i_stp occurs 0,

stlty like stpo-stlty, "BOM category

stlnr like stpo-stlnr, "BOM internal number

postp like stpo-postp, "item category

dokar like stpo-dokar, "document type

doknr like stpo-doknr, "document number

dokvr like stpo-dokvr, "document version

doktl like stpo-doktl, "document part

potx1 like stpo-potx1, "compenent description 1

potx2 like stpo-potx2, "component description 2

menge like stpo-menge, "quanity

lkenz like stp-lkenz, " Deletion Indicator [2]

end of i_stp.

while appending i_stp1 to i_stp its showing

"I_STP" and "I_STP1" are not mutually convertible. In Unicode programs, "I_STP" must have the same structure layout as "I_STP1",independent of the length of a Unicode character.

one more thing STLTY and MENGE are not present in structure STPO_API02 .

How to solve it if anybody know please let me know with sample codes.

Thanks

Tags:
Former Member
replied

When you want to append a line to an internal table, you'll have to make sure that the line and the line of the internal table are of the same type i.e. having the same structure.

Structure STPO_API02 and the structure you declared are not the same.

Easiest way to solve this is to do a MOVE-CORRESPONDING from one structure to the other. This will only work of the fieldnames of both structures are the same.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question