baancust
11th December 2006, 12:47
Hi everybody,
I am using the standard session tdsls4120m000 - Maintain Deliveries .From the special option of this session , I want to use customised session and it has to import the order and positions of the sales order from tdsls4120m000 .
Now since , we do not modify the standard session script , I cannot import more than 1 position of the sales order .
Please can anyone help me regarding the same .

george7a
11th December 2006, 14:33
Hi,

You want to choose which position to import or do you want to import all position?

Can you please tell us what did you do in your customized session?

You can write a SQL that will find all the positions in the current order.

If you want to choose the position read about the mark.table variable:
long mark.table()

This array indicates which records are marked. The size of this array is set to fattr.occurnr. For example, if records 3 and 8 are marked, then:

mark.table(3) = 1
mark.table(8) = 1

and other elements in the array are 0 (false).

long marked

Indicates if there are marked records.


- George

baancust
12th December 2006, 08:43
Hi George,
Thanks for your prompt reply .
Actually the user will be marking multiple records in the session tdsls4120m000 and then activate my session from the special menu of this session .So ideally,what I require is only those records to be processed which have been marked by the user.
Will mark.table() solve my problem since I would be using it in my customised session .

george7a
12th December 2006, 11:33
Hi,

Yes it should solve your problem. As you can see in the documentation it tells you which records are selected.

You might have to import the values of mark.table() into your new session using the import() function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_interprocess_transfer_import)

- George

baancust
13th December 2006, 07:14
Hi George,
Thanks for your reply .I will try out the code myself and then confirm about the same .

sghatge
4th September 2013, 10:52
I have same issue. Anybody tell me how can use mark.table() and marked function for import makred records from another session.

sghatge
4th September 2013, 11:54
Hello, please help me to resolved the issue. This is very urgent.

bhushanchanda
4th September 2013, 13:13
Hi,

Please post your script if you have tried something. That will help people to better understand where you are facing the problem.

sghatge
5th September 2013, 07:09
I am opening the standard session whinh3122m000 - Warehouse Inspections and selecting the multiple lines at a time those i have to update text. After selecting the lines, using customization session (below given script) form specific option to open the text and update this text to all marked lines only. But system not importing the all marked lines. How can i import the marked records for update the text. Form command used in main session as multiple occurance as once.
Script as per below:
-----------------------------
declaration:

table twhinh211 | Warehouse Inspections
table ttttxt010

extern domain tcorno apno.f
extern domain tcorno apno.t
extern domain tcpono apsq.f
extern domain tcpono apsq.t
extern domain whinh.shpm rcno
long retval, i, rc, tmp

domain tctxtn old.itxt, new.itxt
extern domain tttxt.buf old.text(15), new.text(15)
string text.group(8)
string edit.options(15)




#pragma used dll ottstpapihand
#pragma used dll owhinhdll2000

#include <bic_dam>
#include <bic_dialog>
#include <bic_text>
#include "itcmcs0012" |* Compare Double - Macros
#include "itcmcs2000" |* DAL(-GUI) Support Defines
#include "itcmcs2001" |* GUI Support Defines
#include "itcmcs2020" |* UI Engine (for UI template tcmcstempl_ui)
#include "iwhinh0000" |* General Warehousing Functions and Defines
#include "iwhinh2001" |* View Filter Defines
#include "iwhinh0211" |* Defines for Approvals
#include "iwhinh0212" |* Dialog for destroy or reject reason
#include "iwhwmd5000" |* Handling Unit defines


|****************************** program section ********************************

before.program:

import("whinh211.apno", apno.f)
import("whinh211.apsq", apsq.f)
import("whinh211.rcno", rcno)

functions:

function update.text()
{
select whinh211.*
from whinh211 for update
where whinh211.apno = :apno.f
and whinh211.apsq = :apsq.f
selectdo
endselect

old.itxt = whinh211.itxt

rc = set.mem(old.text, "")
rc = text.to.buf("whinh211.itxt", language$, 15, old.text)

|call text editor
whinh.dll2000.fill.textparameters("whinh211.itxt")
retval = text.defaults("whinh211.itxt", text.group, edit.options)
retval = text.edit("whinh211.itxt", attr.textlang$, attr.textkw1$, attr.textkw2$, attr.textkw3$, attr.textkw4$, text.group, edit.options, 3)

rc = set.mem(new.text, "")
rc = text.to.buf("whinh211.itxt", language$, 15, new.text)

rc = 0
for i = 1 to 15
if old.text(1,i) <> new.text(1,i) then
rc = 1
endif
endfor

if rc = 1 then
if old.itxt = whinh211.itxt then
rc = text.copy("whinh211.itxt", "whinh211.itxt", attr.textkw1$, attr.textkw2$, attr.textkw3$, attr.textkw4$, text.group, edit.options)
| commit.transaction()
endif
new.itxt = whinh211.itxt

for i = 1 to filled.occ
if mark.table(i) then
do.occ(i, text.update)
endif
endfor
endif

exit()

}

function void text.update()
{
if mark.table(actual.occ) then
db.retry.point()
|update main table
select whinh211.*
from whinh211 for update
where whinh211.apno = :apno.f
and whinh211.apsq = :apsq.f
selectdo
whinh211.itxt = new.itxt
whinh211.logn = logname$
db.update(twhinh211, db.retry)
commit.transaction()
endselect
endif
}

sghatge
11th September 2013, 06:21
Hi Friends,

Anybody can help me to sort out this problem...

bhushanchanda
11th September 2013, 11:57
Hi,

You should check for the marked records first and for each record you will need to add the text. You can use this method:-

for i=1 to filled.occ
if mark.table(i) then
do.occ(i, some_function)
endif
endfor

I have found a thread to delete marked records. This may help you.

Thread (http://www.baanboard.com/baanboard/showthread.php?t=24545&highlight=delete+exchange)

sghatge
12th September 2013, 07:01
Thanks for reply.

Bhushan, I have already checked function which you have suggested, but it is not working. Please check my code. My problem is only can't import marked inspection records from standard session whinh3122m000. How I can get the marked records in customized session. Please read my code carefully and suggest any solution.

andreas.toepper
17th September 2013, 09:47
I have not used the new possibility of selecting individual lines in LN myself yet, but I modified a printsession in FP8 that used the new NCRS-functionality (Non Consecutive Record Selection). So I had a chance to take a first close look on handling parent selection (but I didn't modify any part of it).
The Design Principle Guide explains NCRS (including source-examples!).

I think the new function do.parent.selection(..) is the key-element, when using NCRS. You may want to check the programmers guide on this new function.
Check KB 22924522 on www.inforxtreme.com. There you find the latest ERP LN programmers guide and (more important) the latest Design Principle Guide.

Regards,
Andreas