‎2009 Apr 30 11:17 AM
Hello,
I'll create a long text for a network activity, but I found no BAPI for that.
When I create long text for an order activity I use the BAPI BAPI_ALM_ORDER_MAINTAIN. There it is possible to specifiy the long text lines.
In the BAPI BAPI_NETWORK_MAINTAIN there ist no table for specifying long text.
Did anyone know how to create a long text for an network activity?
‎2009 May 06 10:38 AM
call function save_text
for Network header text parameters are
Text Name 800000000904099 i.e. client +12 digit Network number
Language EN
Text ID KOPF Order header text
Text Object AUFK Order text
*****************
for network activity
Text Name 800000001298000000001 i.e. sy-mandt + aufpl + aplzl
Language EN
Text ID AVOT Transaction text
Text Object AUFK Order text
‎2009 May 07 6:47 AM
Hello Vivek,
I'll tried this too. My problem was, if I add long text to a existing network activity, everything works well. But in my programm I create a new network plan with one network activity (0010). After commit I become the correct network plan number. Then I try to add long text to the network activity. I get correct return codes but if I look in the transcation CJ20N I could not see some text. If I use the READ_TEXT function with the key I insert the text, I see the text, but not with the transaction CJ20N.
I compared the key I used in my program with the key if I insert text with transaction CJ20N. I could'nt found some differences.
SELECT SINGLE afvcp~mandt afvcp~aufpl afvcp~aplzl
INTO (mandant,aufpl,aplzl)
FROM afvcp INNER JOIN
afko ON
afko~mandt = afvcp~mandt
AND afko~aufpl = afvcp~aufpl
AND afko~aufnr = ordernumbernew.
"*Create Identifier
CONCATENATE
mandant aufpl aplzl
INTO lv_name.
header-tdobject = 'AUFK'.
header-tdname = lv_name.
header-tdspras = sy-langu.
header-tdform = 'SYSTEM'.
header-tdid = 'AVOT'.
header-mandt = sy-mandt.
header-TDLINESIZE = '079'.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = header
insert = 'X'
savemode_direct = 'X'
owner_specified = ' '
local_cat = ' '
IMPORTING
function = func
newheader = newheader
TABLES
lines = lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = header-tdobject
SAVEMODE_DIRECT = 'X'
IMPORTING
COMMIT_COUNT = commit_count
.
COMMIT WORK AND WAIT.For example in the debug the header ist filled with:
1 TDOBJECT C 10 AUFK
2 TDNAME C 70 210000044156300000001
3 TDID C 4 AVOT
4 TDSPRAS C 1 D
5 TDTITLE C 50
6 TDFORM C 16 SYSTEM
7 TDSTYLE C 8
8 TDVERSION N 5 00000
9 TDFUSER C 12
10 TDFRELES C 4
11 TDFDATE D 8 00000000
12 TDFTIME T 6 000000
13 TDLUSER C 12
14 TDLRELES C 4
15 TDLDATE D 8 00000000
16 TDLTIME T 6 000000
17 TDLINESIZE N 3 079
18 TDTXTLINES N 5 00000
19 TDHYPHENAT C 1
20 TDOSPRAS C 1
21 TDTRANSTAT N 1 0
22 TDMACODE1 C 16
23 TDMACODE2 C 16
24 TDREFOBJ C 10
25 TDREFNAME C 70
26 TDREFID C 4 4
In CJ20N the header is filled with
1 TDOBJECT C 10 AUFK
2 TDNAME C 70 210000044156300000001
3 TDID C 4 AVOT
4 TDSPRAS C 1 D
5 TDTITLE C 50
6 TDFORM C 16 SYSTEM
7 TDSTYLE C 8
8 TDVERSION N 5 00000
9 TDFUSER C 12
10 TDFRELES C 4
11 TDFDATE D 8 00000000
12 TDFTIME T 6 000000
13 TDLUSER C 12
14 TDLRELES C 4
15 TDLDATE D 8 00000000
16 TDLTIME T 6 000000
17 TDLINESIZE N 3 079
18 TDTXTLINES N 5 00007
19 TDHYPHENAT C 1
20 TDOSPRAS C 1
21 TDTRANSTAT N 1 0
22 TDMACODE1 C 16
23 TDMACODE2 C 16
24 TDREFOBJ C 10
25 TDREFNAME C 70
26 TDREFID C 4
‎2009 May 07 7:31 AM
for testing purpose add breakpoint after Network activity is created.
once reached the breakpoint, wait for few seconds, then continue in debug.
check if it gets reflected in cj20n.
Looks like issue of commit work.
You may have to add following commands after network & activity is created.
Commit work and Wait.
call function DB_COMMIT
.Edited by: vivek amrute on May 7, 2009 8:34 AM
‎2009 May 07 1:32 PM
Hello Vivek,
I think I solved the problem "dirty". I made some tests with function SAVE_TEXT and transaction CJ20N. Even if long text is entered in CJ20N in the table afvc the field TXTSP is filled with the text language.
In my case (fb SAVE_TEXT) there is no language in this field. If I update the table afvc with the language, the text appears in the CJ20N.
So after calling the function SAVE_TEXT, I update the table afvc:
SELECT SINGLE *
INTO wa_afvc
FROM afvc
WHERE
aufpl = aufpl
AND aplzl = aplzl.
wa_afvc-txtsp = sy-langu.
UPDATE afvc FROM wa_afvc.
COMMIT WORK AND WAIT.
‎2009 May 08 5:20 AM
try hardcoding 'D' or 'E' in place of sy-langu.
I think I had faced similar issue long back in 4.6 . but that was I guess because of D & DE
‎2009 May 08 5:51 AM
Hello Vivek,
thanks, but in my case it works with sy-langu too. I create the network plan and activity with this language and the system format of SY-LANGU(SYLANGU->LANG1) is the same as TDSPRAS(SPRAS->LANG1) .
So my workaround works at the moment and I hope it will be so for future with no changes.