on 12-27-2010 5:40 PM
Hello everybody
In my standard smartform i have an include text with:
text name :&IS_BIL_INVOICE-HD_GEN-BIL_NUMBER&
text object :VBBK
text ID : 0002 " header note"
language :&CONTROL_PARAMETERS-LANGU&
My requirement is to display the text if and only if it contains a value.
So I have no idea on the field with which I have to test, like 'field # initial'.
thanks for your help
Yeah ..READ_TEXT is only the solution for this prob...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't understand which 'value' you're referring to because you haven't been clear about what you've done or where that code is. I can only assume you're referring to the flag variable you created.
The value of 'NAME' in the READ_TEXT call in the code you posted is not valid. You hard-coded the document number but neglected to add the leading zeros. If in fact that invoice has text, you'll never get it. If it were me, I would put the entire logic in the smartform itself as I mentioned before - there's no need to change the standard invoice print program or use a custom print program when you can embed any needed logic in your invoice smartform design.
Thanks Brad .
Im talking about value of my text .!
I added this code to my printer program to get the value of the flag, so i will display the window if and only if the flag is not intial .
The real value of 'NAME' in the READ_TEXT is
NAME = CS_BIL_INVOICE-HD_GEN-BIL_NUMBER
I want separate my programming logic from my presentation,after debuging I found that the function module 'READ_TEXT' returns an empty table.
So I need to know what is the mistake I committed in the call of my function?!
At least you have a variable in the function interface now. I don't recognize the structure though; the standard one is either IS_BIL_INVOICE or GS_HD_GEN. Perhaps that was a typo. If it still doesn't work, it's a simple thing to debug by putting a breakpoint in the function and comparing the values between the test workbench and your smartform call.
Yeah Brad
the standard struct is IS_BIL_INVOICE in the standard smartform ,baut im working in the print program where CS_BIL_INVOICE is the real name.
finally it worked, my code is below in my print program :
SELECT SINGLE TDOBJECT TDNAME TDID TDSPRAS FROM STXH
INTO (STXH-TDOBJECT, STXH-TDNAME, STXH-TDID, STXH-TDSPRAS)
WHERE TDOBJECT = 'VBBK'
AND TDNAME = CS_BIL_INVOICE-HD_GEN-BIL_NUMBER
AND TDID = '0002'
AND TDSPRAS = SY-LANGU.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = STXH-TDID
language = STXH-TDSPRAS
name = STXH-TDNAME
object = STXH-TDOBJECT
TABLES
lines = it_line
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT it_line.
IF it_line-tdline NE ''.
c_text_flag = 'X'.
ENDIF.
ENDLOOP.
I passed the c_text_flag to the interface of my form
Thanks for your help
Why do you need a condition for that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Im traying this code but i dont have any value in 'IT_LINE'
DATA: IT_LINE LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE,
C_TEXTE_FLAG(1) type c .
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = '0002'
LANGUAGE = SY-LANGU
NAME = '90000042'
OBJECT = 'VBBK'
TABLES
LINES = IT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT IT_LINE.
IF IT_LINE-TDLINE NE ''.
C_TEXTE_FLAG = 'X'.
ENDIF.
CLEAR: IT_LINE.
ENDLOOP.
Like I said before, you have some other issue in your design maybe. A blank line does not result if there's nothing maintained in the text object EXCEPT for explicitly entered blank lines. If this is your issue, then I would address it with the person or program that entered it. However, if you must, you need to set a GLOBAL variable in the smartform definition and set the value there in a code node.. Then use that variable on the condition tab.
By the way, hardcoding the value for the name doesn't work unless you actually use the correct value - I can see that you haven't just by looking at the length of your literal...
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.