09-01-2008 6:50 PM
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
09-01-2008 7:52 PM
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.
09-01-2008 7:52 PM
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.
09-01-2008 8:13 PM
As Micky Oestreich sujjested Use MOVE-CORRESPONDING
Syntax:-
MOVE-CORRESPONDING i_stp1 TO i_stp.
refer this help documentation.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3260358411d1829f0000e829fbfe/content.htm
Regards
Bala Krishna