05-18-2007 3:40 PM
Hi all,
I am getting a syntax error in the following perform statement. The error is "<b>Field "VBLKP-MATNR" is unknown.</b> I have VBLKP in the interface. I tried putting it in both the tables tab and the import tab but both give me the same error.
PERFORM convert_to_pallets
USING vblkp-matnr
vblkp-lfimg
vblkp-vrkme
CHANGING w_nbrpal
w_nbrpce
w_nbrft2.
Regards,
Davis
05-18-2007 4:49 PM
Hi,
Please try this.
data: w_bzirk LIKE knvv-bzirk.
data: w_kunnr(10) TYPE c,
w_vkorg(4) TYPE c.
CLEAR w_bzirk.
SELECT * INTO TABLE t_knvv FROM knvv
WHERE kunnr = w_kunnr
AND vkorg = w_vkorg.
data: wa_knvv type t_knvv.
LOOP AT t_knvv into wa_knvv.
TRANSLATE wa_knvv-bzirk TO UPPER CASE.
IF wa_knvv-bzirk = 'CARLSH' OR
wa_knvv-bzirk = 'CCWSH'.
w_bzirk = wa_knvv-bzirk.
EXIT.
ENDIF.
ENDLOOP.
Regards,
Ferry Lianto
05-18-2007 3:45 PM
Be sure to include that field in the input parameters of your Program Lines node.
05-18-2007 3:48 PM
Shoot, thanks a lot for that help!
I have another question along these lines. I have a few performs that I have to copy from several programs. There are many structures needed by these performs. Is there a way to declare these structures in a program lines node so that they are global?
Regards,
Davis.
05-18-2007 3:54 PM
Declare them in Global Definitions. You can define the Types in the Types tab and then declare your tables workareas in the Global Data tab.
05-18-2007 3:56 PM
Alright, thanks. I was trying to declare the table in the types section and it wasn't working. I now know why.
Thanks again for your help!
05-18-2007 3:57 PM
Hi Davis,
You can declare them at global definitions.
Regards,
Ferry Lianto
05-18-2007 4:02 PM
Here is what I have in an abap program. I need to copy a perform from this program and include some structures/tables in my SmartForm. The following is an example of the tables.
DATA: BEGIN OF T_KNVV OCCURS 0.
INCLUDE STRUCTURE KNVV.
DATA: END OF T_KNVV.
I tried to delcare a strutcure like this:
[code]TYPES: BEGIN OF ty_knvv,
include structure knvv,
END OF ty_knvv.[/quote]
But it gives me a syntax error asking for a ',' after INCLUDE.
Regards,
Davis
05-18-2007 4:07 PM
In the Global Definitions - Global Data do this
I_KNVV TYPE TABLE OF KNVV INITIAL SIZE 0
Variable Name = I_KNVV
Type = TYPE
Reference = TABLE OF KNVV INITIAL SIZE 0
Message was edited by:
Matt Nagel
05-18-2007 4:14 PM
Matt, thanks for the suggestion. However I still get a syntax error when I am trying to access a field in t_knvv. I get the syntax error "<b>Field "T_KNVV-BZIRK" is unknown.</b>
IF T_KNVV-BZIRK = 'CARLSH' OR
T_KNVV-BZIRK = 'CCWSH'.
Regards,
Davis
05-18-2007 4:25 PM
If you are doing it Ferry's way then you will have to have it like this
IF T_KNVV-KNVV-BZIRK = 'CARLSH' OR
T_KNVV-KNVV-BZIRK = 'CCWSH'.
If you are doing it my way then you will need to loop at the table into a workarea first. I think.
05-18-2007 4:31 PM
Sorry, I thought it was working but it is still giving me the same error.
Message was edited by:
Davis
05-18-2007 4:03 PM
05-18-2007 4:11 PM
Hi Davis,
Please try this.
TYPES: BEGIN OF TY_KNVV,
KNVV TYPE KNVV,
END OF TY_KNVV.
Regards,
Ferry Lianto
05-18-2007 4:16 PM
Ferry, I just tried that and I still get the syntax error on T_KNVV-BZIRK.
Regards,
Davis
05-18-2007 4:32 PM
Hi Davis,
Please try this.
TYPES: TY_KNVV TYPE KNVV.
...
IF TY_KNVV-BZIRK = 'CARLSH' OR
TY_KNVV-BZIRK = 'CCWSH'.
...
ENDIF.
Also can you show your coding?
Regards,
Ferry Lianto
05-18-2007 4:40 PM
Ferry, here is my code:
*&---------------------------------------------------------------------*
*& Form CHECK_KNVV
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM check_knvv.
data: w_bzirk LIKE knvv-bzirk.
data: w_kunnr(10) TYPE c,
w_vkorg(4) TYPE c.
CLEAR w_bzirk.
SELECT * INTO TABLE t_knvv FROM knvv
WHERE kunnr = w_kunnr
AND vkorg = w_vkorg.
LOOP AT t_knvv.
TRANSLATE t_knvv-bzirk TO UPPER CASE.
IF t_knvv-bzirk = 'CARLSH' OR
t_knvv-bzirk = 'CCWSH'.
w_bzirk = t_knvv-bzirk.
EXIT.
ENDIF.
ENDLOOP.
ENDFORM. " CHECK_KNVV
It is still not recognizing any field in T_KNVV.
Regards,
Davis
It loops at and into t_knvv without a problem. The error is when you try to access t_knvv-bzirk.
Message was edited by:
Davis
05-18-2007 4:49 PM
Hi,
Please try this.
data: w_bzirk LIKE knvv-bzirk.
data: w_kunnr(10) TYPE c,
w_vkorg(4) TYPE c.
CLEAR w_bzirk.
SELECT * INTO TABLE t_knvv FROM knvv
WHERE kunnr = w_kunnr
AND vkorg = w_vkorg.
data: wa_knvv type t_knvv.
LOOP AT t_knvv into wa_knvv.
TRANSLATE wa_knvv-bzirk TO UPPER CASE.
IF wa_knvv-bzirk = 'CARLSH' OR
wa_knvv-bzirk = 'CCWSH'.
w_bzirk = wa_knvv-bzirk.
EXIT.
ENDIF.
ENDLOOP.
Regards,
Ferry Lianto
05-18-2007 4:52 PM
Thanks a lot Ferry. I keep forgetting that these program nodes are just small abap editors and that I can treat them as such.
I used your code but changed
data: wa_knvv type t_knvv.
to
data: wa_knvv like line of t_knvv.
Regards,
Davix